#P3219. [HNOI2012] 三角形覆盖问题
[HNOI2012] 三角形覆盖问题
Description
In the two-dimensional plane, you are given isosceles right triangles (each triangle’s two legs are parallel to the coordinate axes, and the hypotenuse goes from top-left to bottom-right). We use three non-negative integers to describe such a triangle. The coordinates of its three vertices are , , and . Compute the total area covered by these triangles. For example, in the figure below, there are triangles, and the total covered area is .

Input Format
The first line contains a positive integer , indicating the number of triangles. Each of the next lines contains three space-separated non-negative integers , describing a triangle whose vertices are , , and , where satisfy .
Output Format
Output a single line containing a real number , the total area covered by all triangles, with exactly one decimal place. It is guaranteed that .
3
1 1 4
2 0 2
3 2 2
11.0
Hint
For of the testdata, . For of the testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号