1) Examining the problem, we have to draw this to better understand that. Let's do it, below:
2) Now, let's find the measure of the Diagonal "D". And for that, we can use the Pythagorean Theorem
D²= 12²+3²
D²=144+9
D²=153
√D²=√153
D=√153
Then, as a consequence, we can find the other hypotenuse of that triangle called "d"
d²=(√153)²+(3)²
d²=153 +9
d²=162
d=9√2 ≈ 12.73 inches
3) So the greatest length in whole inches that the part could have been is 12 inches. If the part is 13 that won't fit in the box, the question asks whole inches.