407713: GYM102881 B Anany in the Army
Description
Anany was happily doing his military service, but someday he got bored. He was daydreaming about the moment he gets back to problem-solving when he suddenly noticed three sticks on the ground. He challenged his soul (pun intended) to solve the following problem:
You can choose $$$\textbf{one}$$$ stick and increase its length by any amount (integer or non-integer) less than or equal to $$$k$$$ units. You will then form a triangle using the sticks. What is the maximum area of a triangle that you can get?
InputThe first line of input contains an integer $$$T$$$, the number of test cases.
Each of the next $$$T$$$ lines contains 4 space-separated integers each — the lengths of the 3 sticks, followed by $$$k$$$.
All the numbers are positive integers and do not exceed $$$10^4$$$.
It's guaranteed you can always form a non-degenerate triangle.
OutputFor each test case, print the maximum area on a single line. The answer will be considered correct if its absolute or relative error does not exceed $$$10^{-4}$$$.
ExampleInput2 1 1 1 2 3 4 4 1Output
0.500000000 6.928203230