Quad Area
You are trying to build a house, but unfortunately you currently have only four available walls with side lengths a, b, [], and d. You want your house to be as big as possible, so you would like to know the largest possible area of any quadrilateral you can construct with these four side lengths.
InputThe first line of standard input contains the integer T (1 ≤ T ≤ 2,000), the number of tests. Each test contains a single line with four real numbers: a, b, c, and d (0 < a, b, c, d < 1,000). Note that it will always be possible to form a valid quadrilateral with these lengths; that is, the sum of any three side lengths will be strictly larger than the other one.
OutputFor each test case, print a single line to standard output containing the largest possible area. Your output will be accepted if it is within 0.01 of the official answer.
Input:
[c]2
1 2 1 2
0.5 0.5 0.5 0.5
Output:
2.00
0.25For the first test case, it is optimal to construct a rectangle, and for the second, a square is optimal.
Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.