Given the side lengths of a rectangular box, compute the squared length of the shortest surface path between opposite corners.
Medium5GeometryMathNo attempts yetTime limit1sMemory limit256 MBSeunghyun's eraser is a rectangular box. After spending the whole vacation doing nothing in his room, he noticed an ant sitting on the eraser. The ant is not a real ant. It is a robot that someone left in the room.

The ant robot moves only over the surface of the eraser. It cannot cut through the inside, and it cannot fly. It walks from one corner A of the eraser to the diagonally opposite corner B along a shortest path on the surface, and it leaves a mark everywhere it passes. Treat the robot as a point with no size.
Seunghyun hates marks on his eraser and wants to claim damages, so he needs the length of the mark, which is the distance the robot traveled. Given the three side lengths of the eraser, compute that distance for him.
The first line contains the number of test cases T. (1≤T≤100000)
Each of the next T lines contains three integers a, b, c separated by spaces. a is the width of the eraser, b is the depth, and c is the height. (1≤a,b,c≤100000)
For each test case, print the square of the distance the ant robot traveled, one value per line. Seunghyun does not want any rounding error, so print the square of the distance instead of the distance itself. This value is always an integer.