Ex. 119. The lengths of the sides of a triangle are integers. It is known that the height, drawn to one of the sides, divides it into integer segments, the difference of which is 7. For what smallest value of the length of this side is the height, drawn to it, also an integer?
Ex. 119. 25. Solution. Let $A B C$ be the considered triangle, $B D$ be the height. Denote $A D=x, D C=y, A D=h$. Let $y>x \Rightarrow y-x=7 \Rightarrow x=\frac{b-7}{2}$. Expressing the height in two ways, we get the equality $a^{2}-y^{2}=c^{2}-x^{2} \Rightarrow$ $(y-x)(y+x)=(a-c)(a+c) \Rightarrow 7 b=(a-c)(a+c)$. Since $a+c>b$, then $a-c=k, a+c=7 n$, where $1 \leq k<7, b=k n, x=\frac{k n-7}{2}$. From this, $a=\frac{7 n+k}{2}, c=$ $\frac{7 n-k}{2} \Rightarrow \frac{(7 n+k)^{2}}{4}-\frac{(k n-7)^{2}}{4}=h^{2} \Rightarrow\left(n^{2}-1\right)\left(49-k^{2}\right)=h^{2}$. Note that $k$ and $n$ must be odd numbers. Thus, for $k$ there are only the following cases: $k=1,3,5$. By trying the possibilities, we find that $k=5, n=5$ give the smallest value of $b$. From this, $a=20, b=25, c=15$ (the triangle is right-angled). In this case, $x=9, y=16$. Note. If we allow that the length of one of the segments into which the height divides the side $A C$ can be zero, then another option is possible: $a=25, c=24, b=7(x=0)$.