If all three side lengths are INTEGERS and form PYTHAGOREAN TRIPLE then we know decimals are not allowed
if 24 and 51 are both legs then

x = 3177
and squre root of that gives us 56.364.... NOT an integer
So that means one of them is not a leg and since hypotenuse is longer than both legs, 51 must be the hypotenuse so to get the third side

=2025
x=45, leg B