the 12 - 16 triangle has a hypotenuse of 20 (via pythag theorem)
20 is to 16 as x is to 20
20/16 = x/20
x = 25
Triangle with legs 12 & 16 has a hypotenuse of 144+256=400, sqrt400=20.
Now, realize that these are similar triangles (as an exercise, figure out why!)
So, we have 20:16=x:20
Solve that.