^
always remember the pythagorean triple:

no need for the very long solution..

because.. the triple is 3,4,5

so 3 is the shortest leg, 5 is the hypotenuse and as follows..

so if 20 is the hypotenuse the triple will be 12,16 and 20.. why?? same as 3,4 and 5..

i just gave you a short tip.. because in math quiz shows.. 5 seconds is enough for that question to know the two legs..

(based on experience.. haha)