8. (30 points) On the sides $A B$ and $A D$ of the square $A B C D$, points $E$ and $F$ are marked such that $BE : EA = AF : FD = 2022 : 2023$. Segments $E C$ and $F C$ intersect the diagonal of the square $B D$ at points $G$ and $H$ respectively. Find $GH : BD$.
Answer: $G H: B D=12271519: 36814556$.

First solution. We will solve the problem in a general form: $B E: E A=A F: F D=2022: 2023=$ $=m: n$. Let $B E=A F=m x, E A=F D=n x$, then $B C=C D=(m+n) x$, $B D=(m+n) x \sqrt{2}, E C^{2}=\left(m^{2}+(m+n)^{2}\right) x^{2}, F C^{2}=\left(n^{2}+(m+n)^{2}\right) x^{2}$. Note that $B D$ is the angle bisector in triangles $B E C$ and $D F C$. Using the known properties of the angle bisector, we find that $E G=\frac{m}{2 m+n} E C, G C=\frac{m+n}{2 m+n} E C, F H=\frac{n}{2 n+m} F C$, $H C=\frac{m+n}{2 n+m} F C$.

![](https://cdn.mathpix.com/cropped/2024_05_06_de56aaa25ca847a38066g-6.jpg?height=465&width=480&top_left_y=156&top_left_x=662)

Using the formula for the length of the angle bisector, we find

$$
\begin{aligned}
B G^{2}= & B E \cdot B C-E G \cdot G C=m(m+n) x^{2}-\frac{m(m+n)}{(2 m+n)^{2}}\left(m^{2}+(m+n)^{2}\right) x^{2}= \\
& =\frac{m(m+n) x^{2}}{(2 m+n)^{2}}\left((2 m+n)^{2}-m^{2}-(m+n)^{2}\right)=\frac{2 m^{2}(m+n)^{2} x^{2}}{(2 m+n)^{2}}
\end{aligned}
$$

that is, $B G=\frac{\sqrt{2} m(m+n) x}{2 m+n}$. Similarly, we find that $D H=\frac{\sqrt{2} n(m+n) x}{2 n+m}$. Now everything is ready to calculate the answer:

$$
\frac{G H}{B D}=\frac{B D-B G-D H}{B D}=1-\frac{m}{2 m+n}-\frac{n}{2 n+m}=\frac{m^{2}+m n+n^{2}}{(2 m+n)(2 n+m)}
$$

Substituting the values $m=2022, n=2023$, we find $G H: B D=12271519: 36814556$.

Second solution. Triangles $E B G$ and $G C D$ are similar (by two angles), so $\frac{B G}{G D}=\frac{B E}{C D}=\frac{2022}{4045}$ and $\frac{B G}{B D}=\frac{2022}{6067}$. Similarly, triangle $H F D$ is similar to triangle $H B C$, so $\frac{H D}{B H}=\frac{F D}{B C}=\frac{2023}{4045}$ and $\frac{H D}{B D}=\frac{2023}{6068}$. Then the desired ratio

$$
\frac{G H}{B D}=1-\frac{B G}{B D}-\frac{H D}{B D}=\frac{12259387}{36778160} .
$$