## Task B-3.5.

Which of the right-angled triangles with integer sides and one leg of length $1000 \mathrm{~cm}$ has the largest possible perimeter?
## Solution.

Let $c$ be the hypotenuse and $a, b$ be the legs of a right triangle. Suppose the length of the leg $a=1000 \mathrm{~cm}$. Then we have

$$
c^{2}-b^{2}=1000^{2}, \text { or }(c-b)(c+b)=10^{6}
$$

If the perimeter of the triangle $O=a+b+c$ is to have the maximum value, then $b+c$ must be the largest factor of $10^{6}$. Then we have

$$
\begin{aligned}
& c+b=10^{6} \\
& c-b=1
\end{aligned}
$$

but the solution to this system $c=\frac{10^{6}+1}{2}$ is not an integer.

To maximize the perimeter, the next possibility for $c+b$ and $c-b$ is

$$
\begin{aligned}
& c+b=5 \cdot 10^{5} \\
& c-b=2
\end{aligned}
$$

Adding these equations, we get

$$
2 c=5 \cdot 10^{5}+2
$$

so $c=250001 \mathrm{~cm}$, and $b=249999 \mathrm{~cm}$.