A similar question is discussed here:

A carpenter wants to ship a copper rod to his new construction location in his toolbox. The rod cannot be bent and has a negligible width. The rectangular tool case he is using is 12 inches wide by 16 inches long by 20 inches high. Which of the following is the longest possible rod that can fit in the toolbox?
A. 22 inches B. 25 inches C. 28 inches D. 30 inches E. 34 inches
(C) The longest straightline distance in a rectangular box is a diagonal line from the upper corner to the opposite lower corner. This distance will be the hypotenuse of a right triangle. The height of this triangle will be the height of the box, 20 inches, and the base of the triangle will be the diagonal of the toolbox bottom. The diagonal of the toolbox bottom is the hypotenuse of a right triangle with sides of 12 inches (width) and 16 inches (length). This is a 345 right triangle, and the hypotenuse is 20 inches. So the diagonal of the bottom of the box is 20 inches.
Now, to find the longest possible length of the rod, we need to find the hypotenuse of a triangle that has sides of 20 inches. This is an isosceles right triangle. The hypotenuse of an isosceles right triangle is √2 multiplied by the length of a leg of the isosceles triangle. The answer is 20√2, which will be the length of the diagonal from the upper corner to lower opposite corner.
Since 20√2 equals approximately 20 times 1.41, or just over 28, the longest rod that can fit will be 28 inches. 
very tough question
