5. (8 points) Rectangles $A B C D, D E F G, C E I H$ have equal areas and integer sides. Find $D G$, if $B C=29$.

![](https://cdn.mathpix.com/cropped/2024_05_06_f5010c49868bbc23ccb1g-22.jpg?height=431&width=488&top_left_y=1058&top_left_x=750)
Answer: 870

Solution: Let $D E=a$ and $E C=b$. Then the area of the rectangles $S=29(a+b)$. According to the condition, $S$ is divisible by $a$ and $b$, that is, $S=a k$ and $S=b l$, where $k=D G$ and $l=C H-$ are natural numbers. Then $a=\frac{S}{k}$ and $b=\frac{S}{l}$. We get that $S=\frac{29 S}{k}+\frac{29 S}{l}$. Therefore, $k l=29(k+l)=>$ $k l-29 k-29 l+841=841=>(k-29)(l-29)=841$. Since $l<k$, that is, $l-29<k-29$. Therefore, $l-29=1$ and $k-29=841$. Thus, $k=D G=870$.