Let's call the legs
and
,
being the shortest, and the hypotenuse
.
The first sentence translates to

The second sentence translates to

So, we can express all sides in terms of
and substitute the expressions in the Pythagorean threorem:

Expand the squares:

Bring everything to the left hand side and simplify:

This equation has solutions
and
.
We can't accept negative lengths, so the answer is
.
From here, it's easy to get the other sides:

