#P3844. [TJOI2007] 圆

    ID: 4543 远端评测题 1000ms 125MiB 尝试: 0 已通过: 0 显示难度普及+/提高− 上传者: 标签>2007各省省选天津

[TJOI2007] 圆

Problem Description

There are nn 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 nn, the number of circles.

Each of the following nn lines contains three integers x,y,rx, y, r describing a circle whose center is at (x,y)(x, y) and whose radius is rr. 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 100%100\% of the testdata, 0n1000 \le n \le 100. For all circles, x,y,r1000|x|, |y|, r \le 1 000.

Translated by ChatGPT 5