8.52 The carpet merchant Alibaba has a rectangular carpet of unknown dimensions. Unfortunately, his measuring tape is broken, and he has no other measuring tools. However, he discovers that if he lays the carpet flat in either of his two store rooms, each corner of the carpet meets a different wall of the room. He knows that the length and width of the carpet are both integers in feet. The two rooms have one side of the same length (unknown), and the other sides are 38 feet and 50 feet, respectively. Find the dimensions of the carpet. (1 foot = 0.3048 meters)
(30th International Mathematical Olympiad Preliminary Problem, 1989)
【Sol】Let the other side of the room be $q$ feet.
As shown in the figure, let $A E=a, A F=b$.
It is easy to prove
$\triangle A E F \cong \triangle C G H \sim \triangle B H E \cong$
$\triangle D F G$.
Let the similarity ratio of these two sets of similar triangles be
$k$, then
$$
B E=b k, \quad D F=a k .
$$

So we have $\left\{\begin{array}{l}a+b k=50, \\ a k+b=q .\end{array}\right.$

Solving, we get
$$
\begin{array}{c}
\left\{\begin{array}{l}
a=\frac{q k-50}{k^{2}-1}, \\
b=\frac{50 k-q}{k^{2}-1} .
\end{array}\right. \\
x^{2}=a^{2}+b^{2}=\frac{(q k-50)^{2}}{\left(k^{2}-1\right)^{2}}+\frac{(50 k-q)^{2}}{\left(k^{2}-1\right)^{2}}
\end{array}
$$

Similarly, for the other room, we have
$$
x^{2}=\frac{(q k-38)^{2}}{\left(k^{2}-1\right)^{2}}+\frac{(38 k-q)^{2}}{\left(k^{2}-1\right)^{2}}
$$

From (1) and (2), we get
$$
(q k-50)^{2}+(50 k-q)^{2}=(q k-38)^{2}+(38 k-q)^{2} .
$$

Simplifying, we get
$$
\begin{array}{c}
1056 k^{2}-48 k q+1056=0, \\
22 k^{2}-k q+22=0 .
\end{array}
$$
$$
\begin{array}{l}
k q=22\left(k^{2}+1\right), \\
q=22\left(k+\frac{1}{k}\right) .
\end{array}
$$

Since $x, y$ are integers, then $k=\frac{y}{x}$ is a rational number.
Let $k=\frac{c}{d}$, where $c, d$ are positive integers, and $(c, d)=1$.
Equation (3) becomes
$$
\begin{array}{l}
q=22\left(\frac{c}{d}+\frac{d}{c}\right), \\
d q=22\left(c+\frac{d^{2}}{c}\right) .
\end{array}
$$

Since $d q$ is an integer, then $22\left(c+\frac{d^{2}}{c}\right)$ is an integer, thus
$$
c \mid 22, c \in\{1,2,11,22\} \text {, }
$$

Similarly, $d \mid 22, d \in\{1,2,11,22\}$.
Since $(c, d)=1$, without loss of generality, assume $c>d$, then
$$
k=1,2,11,22, \frac{11}{2} \text {. }
$$

From (3), the corresponding $q$ is
$$
q=44,55,244,485,125 \text {. }
$$

From (1), we get
$$
\begin{array}{l}
x^{2}\left(k^{2}-1\right)^{2}=q^{2} k^{2}-100 q k+2500+2500 k^{2}-100 q k+q^{2}, \\
x^{2}\left(k^{2}-1\right)^{2}=q^{2}\left(k^{2}+1\right)+2500\left(k^{2}+1\right)-200 q k . \\
\text { From (3) } \quad k q=22\left(k^{2}+1\right) .
\end{array}
$$

From (3),
Substituting into (4), we get
$$
x^{2}\left(k^{2}-1\right)^{2}=\left(k^{2}+1\right)\left(q^{2}-1900\right) \text {. }
$$

When $k=1$, (5) becomes
$$
0=\left(1^{2}+1\right)\left(44^{2}-1900\right)=72 .
$$

Clearly, this cannot hold.
When $k=2$, $q=55$, substituting into (5) we get
$$
x=25, \quad y=2 \cdot 25=50 .
$$

Thus, the carpet size is 25 feet - 50 feet.
When $k=11$, $q=244$, then
$$
61\left|k^{2}+1,61\right| q^{2}, 61 \nmid 1900 \text {. }
$$

Thus, $61 \mid\left(k^{2}+1\right)\left(q^{2}-1900\right)$.

But
$$
61^{2} \nmid k^{2}+1, \quad 61 \nmid q^{2}-1900,
$$

So
$$
61^{2} \nmid\left(k^{2}+1\right)\left(q^{2}-1900\right) \text {, }
$$

Thus $\left(k^{2}+1\right)\left(q^{2}-1900\right)$ is not a perfect square.
But the left side of (5) is $x^{2}\left(k^{2}-1\right)^{2}$, a perfect square, leading to a contradiction.
When $k=22$, $q=485$.
Then $97|q=485, \quad 97| k^{2}+1$.
Therefore, $97 । \left(k^{2}+1\right)\left(q^{2}-1900\right)$.
But $97^{2} \nmid\left(k^{2}+1\right)\left(q^{2}-1900\right)$.
Thus $\left(k^{2}+1\right)\left(q^{2}-1900\right)$ is not a perfect square, leading to another contradiction.
When $k=\frac{11}{2}$, $q=125$.
Then
$$
\begin{aligned}
k^{2}+1 & =\frac{125}{4}, \quad k^{2}-1=\frac{117}{4}, \\
x^{2} \cdot 117^{2} & =4 \cdot 125 \cdot\left(125^{2}-1900\right) \\
x^{2} \cdot 117^{2} & =50^{2} \cdot 5 \cdot 549 \\
x^{2} \cdot 117^{2} & =5^{5} \cdot 4 \cdot 3^{2} \cdot 61
\end{aligned}
$$

The right side of the above equation is not a perfect square, leading to another contradiction.
Therefore, only $k=2$ is possible, i.e., the carpet size is 25 feet - 50 feet.