21. Given a square with side length $x$ inscribed in a right-angled triangle with side lengths $3, 4, 5$, and one vertex of the square coincides with the right-angle vertex of the triangle; a square with side length $y$ is also inscribed in the right-angled triangle with side lengths $3, 4, 5$, and one side of the square lies on the hypotenuse of the right-angled triangle. Then the value of $\frac{x}{y}$ is $(\quad)$.
(A) $\frac{12}{13}$
(B) $\frac{35}{37}$
(C) 1
(D) $\frac{37}{35}$
(E) $\frac{13}{12}$
21. D.

As shown in Figure 4, let $A D=x$, and the square $A F E D$ is inscribed in the right triangle $\triangle A B C$. Then
$$
\begin{array}{l}
\triangle A B C \backsim \triangle D E C \Rightarrow \frac{D E}{A B}=\frac{C D}{A C} \\
\Rightarrow \frac{x}{4}=\frac{3-x}{3} \Rightarrow x=\frac{12}{7} .
\end{array}
$$

As shown in Figure 5, let $Q R=y$, and the square $S T Q R$ is inscribed in the right triangle $\triangle A^{\prime} B^{\prime} C^{\prime}$. Then
$$
\begin{array}{l}
\triangle A^{\prime} B^{\prime} C^{\prime} \subset \triangle R B^{\prime} Q \backsim \triangle S T C^{\prime} \\
\Rightarrow \frac{4}{3} y+y+\frac{3}{4} y=5 \Rightarrow y=\frac{60}{37} . \\
\text { Hence } \frac{x}{y}=\frac{37}{35} .
\end{array}
$$