A right-angled triangle has a perimeter of $40 \mathrm{~cm}$. If the smaller leg is increased by $4 \mathrm{~cm}$, and the larger leg is increased by $1 \mathrm{~cm}$, then the hypotenuse increases by $3 \mathrm{~cm}$. What are the lengths of the sides of the triangle?
If $a$ is the smaller, and $b$ is the larger leg, then according to the problem

$$
a^{2}+b^{2}=(40-a-b)^{2}, \text { or } 40 a+40 b-a b=800
$$

and

$$
(a+4)^{2}+(b+1)^{2}=(43-a-b)^{2}, \text { or } 47 a+44 b-a b=916
$$

Subtracting (2) from (1)

$$
7 a+4 b=116
$$

Substituting the value of $a$ from (3) into (2):

$$
b^{2}+b-240=0
$$

from which the positive root is:

$$
b=15 \text{ cm and thus } a=8 \text{ cm}
$$

(Klein Adolf, Székesfehérvár.)