Bruce is inspecting the forest coverage in Trianglesland, where each forest is an isosceles right triangle. To simplify the problem, the map of Trianglesland can be treated as an - plane and there are forests in this plane. For each forest, the two right-angle sides are parallel to the axes, while the hypotenuse is from top left to bottom right, which is illustrated in the following figure.
In Trianglesland, each forest is denoted by three non-negative integers , representing the coordinates of three vertices , , and . Bruce has obtained the vertex coordinates of each forest. But some forests overlap. Can you write a program to help Bruce calculate the area covered by the forest (the gray regions in the following figure)?
Input Specification
The first line of input will consist of one integer , the number of forests in Trianglesland.
Each of the next lines will consist of three integers , , , representing that the vertex coordinates of the forest are , , and . .
In of the test cases, .
In of the test cases, .
Output Specification
Output the total area covered by the forest, rounded to one decimal place.
Sample Input
3
1 1 4
2 0 2
3 2 2
Sample Output
11.0
Comments