This is my first post, so I would rely on the answer's of others before mine.
The question is basically asking for the longest line located within the box. In a three dimentional box, this would be an upper corner and an opposite side's lower corner. Verbally its hard for me to explain, so if you can draw 3d pictures I suggest doing it and then try to follow my explanation.
You need to solve for two triangles. The first (1) being located on the cubes base, and the second (2) being made up of the cube's height, hypotenuse of the base (hypotenuse) from (1), and the hypotenuse from the upper corner to opposite lower corner.
To make the sides, you have 3 x 4 x 12.
Make the base triangle have sides 3 and 4. This will give the cube a base of 4 x 3 and height of 12.
Using a^2 + b^2 + c^2 will give you a (1) triangle of 4x3x5. You now have two sides of the second triangle (height 12 and base 5).
Now to find the longest point, which is the hypotenuse of (2). Once again, a^2 + b^2 + c^2, and you will have a triaangle of 5x 12 x 13. 13 is your answer.
Again this is my first post, so I would wait till other confirm of correct my answer.