Robin Sparkle went to the mall one day. While shopping, she remembered that she has a homework due the next day. She recalled that she has to solve a problem regarding a quadrilateral inscribed in a circle.
Robin gives you the following information about the quadrilateral:
: Lengths of three arbitrarily chosen sides of the quadrilateral.
: Radius of the circle it is inscribed in.
Help her calculate the area of the quadrilateral. Robin's robot has broken down trying to solve this problem. You are her only hope.
The first line of the input will contain an integer () denoting the number of test cases. lines follow. Each of these lines contain four positive real numbers , , () and (). These numbers may contain up to 7 digits after the decimal point.
The sum of lengths of the arcs cut by any two of the given sides is greater than or equal to the length of the arc cut by the other side. You can safely assume that the sides form a simple convex polygon and the fourth side has a positive length.
For each case, you have to print the area of the inscribed quadrilateral on a separate line. Absolute error less than will be ignored.
Input | Output |
---|---|
2 14.1421356 14.1421356 14.1421356 10 7 7 7 5 | 200.0000000 49.9700030 |
This image represents the first case given in the sample. The radius is of length 10 and the lengths sides of the quadrilateral are same, . Hence, the area of the quadrilateral is . |