What is the length of the shorter leg of a right triangle whose hypotenuse is 50 inches long and whose perimeter is 112 inches?

a) 18 inches
b) 30 inches
c) 40 inches
d) 42 inches