#P2510. [HAOI2008] 下落的圆盘

[HAOI2008] 下落的圆盘

Description

There are n disks falling from the sky, and those that fall later can cover those that fell earlier. Find the perimeter of the final closed region formed. See the figure below; the total length of all the red curves is the required answer.

Input Format

The first line contains an integer n.

Each of the next n lines contains three real numbers r_i, x_i, y_i, representing the radius and the center coordinates of the i-th disk.

Output Format

Output the final perimeter, to three decimal places.

2
1 0 0
1 1 0
10.472

Hint

Constraints

1 ≤ n ≤ 1000.

Translated by ChatGPT 5