RedField

Time Limit: 1000ms
Memory Limit: 32768KB
This problem will be judged on HDU. Original ID: 1714
64-bit integer IO format: %I64d      Java class name: Main

Description

As the graph you see below, we named the red part "RedField".The read part is the intersection of an ellipse and a triangle.Now, 8600's not good at math, so he wants you to help him calculate the area of the "RedField".

Input

The first line of input contains n, the number of test cases. n lines follow.Each test case contains four numbers a, b, x, y(0 < b <= a <= x),and a is the lenth of OA, b is the lenth of OB,and x, y representing the coordinate of the point P.

Output

For each test case, output the area of the "RedField",accurate up to 2 decimal places.

Sample Input

1
1.00 1.00 2.00 2.00

Sample Output

0.39

Source

Language: 
Theme: 
Share Code? 

Powered by NB231 | Current Style: .