#P3844. [TJOI2007] 圆
[TJOI2007] 圆
Description
There are circles on the plane. Any two distinct circles are either disjoint (they may be externally tangent) or one contains the other (they may be internally tangent).
Initially, the entire plane is black. We draw these circles on the plane in the given input order. When we draw a circle, we invert the color of every point covered by that circle: if a point was black, paint it white; if it was white, paint it black.
After all circles are drawn following this procedure, output the total area of all white regions on the plane.
Input Format
The first line contains an integer , the number of circles.
Each of the following lines contains three integers describing a circle whose center is at and whose radius is . The drawing order is the same as the input order.
Output Format
Output a single real number rounded to two decimal places: the total area of all white regions on the plane.
3
0 0 5
0 1 2
10 10 1
69.12
Hint
For of the testdata, . For all circles, .
Translated by ChatGPT 5
京公网安备 11011102002149号