## Task A-1.2.

In a right-angled triangle, the lengths of all sides are natural numbers, and the radius of the inscribed circle is 4. Determine all possible values of the lengths of the legs of this triangle.
## First Solution.

Let the legs of the right triangle be denoted by $a$ and $b$, the hypotenuse by $c$, and the radius of the inscribed circle by $r$. By equating the formulas for the area of the right triangle, we get

$$
\begin{aligned}
& r \cdot \frac{a+b+c}{2}=P=\frac{a b}{2} \\
& a b-4 a-4 b=4 c
\end{aligned}
$$

By squaring the last equation and applying the Pythagorean theorem, we further obtain

$$
\begin{aligned}
& (a b-4 a-4 b)^{2}=16 c^{2} \\
& (a b-4 a-4 b)^{2}=16 a^{2}+16 b^{2} \\
& a^{2} b^{2}-8 a^{2} b-8 a b^{2}+32 a b=0 \\
& a b(a b-8 a-8 b+32)=0
\end{aligned}
$$

Since $a$ and $b$ are the sides of the triangle, they must be positive, so we can divide the last equation by $a b$ and obtain the equation

$$
a b-8 a-8 b+32=0
$$

which can be factored into the form

$$
(a-8)(b-8)=32
$$

Since $a$ and $b$ are integers, the numbers $a-8$ and $b-8$ must be divisors of 32. We need to check 12 possibilities, of which 6 can be skipped under the assumption that $a$ is less than $b$. Thus, we consider the possibilities:

$$
\begin{array}{ll}
a-8=-32 & a-8=1 \\
a-8=-16 & a-8=2 \\
a-8=-8 & a-8=4
\end{array}
$$

By substituting into the initial equation and considering that $a$ must be positive, we conclude that the following pairs of legs satisfy the conditions of the problem

$$
(9,40),(10,24),(12,16),(16,12),(24,10),(40,9)
$$

For each of these pairs, we calculate $c$ using the Pythagorean theorem and verify that $\frac{a b}{a+b+c}=4$.