#P4631. [APIO2018] 选圆圈
[APIO2018] 选圆圈
Description
On a plane, there are circles, denoted by . We try to run the following algorithm on these circles:
- Find the circle with the largest radius. If there are multiple circles with the largest radius, choose the one with the smallest index. Denote it as .
- Delete and all circles that intersect with it. Two circles intersect if and only if there exists a point on the plane that lies inside or on the boundary of both circles. (Literal translation of the original: If there exists a point on the plane that is contained by both circles, we say these two circles intersect. A point is contained by a circle if and only if it lies inside the circle or on its boundary.)
- Repeat the above two steps until all circles are deleted.

When is deleted, if the circle chosen in Step 1 of that iteration is , we say that is deleted by . For each circle, find which circle deletes it.
Input Format
The first line contains an integer , indicating the number of circles on the plane initially.
The next lines each contain three integers , describing the coordinate, the coordinate of the center of circle , and its radius, respectively.
Output Format
Output one line containing integers , where means that circle is deleted by circle .
11
9 9 2
13 2 1
11 8 2
3 3 2
3 12 1
12 14 1
9 8 5
2 8 2
5 2 1
14 4 2
14 14 1
7 2 7 4 5 6 7 7 4 7 6
Hint
Hint
The picture in the statement corresponds to the situation in Sample 1.
Subtasks
- Subtask 1(points: ): .
- Subtask 2(points: ): , and for all circles .
- Subtask 3(points: ): , and each circle intersects with at most one other circle.
- Subtask 4(points: ): , and all circles have the same radius.
- Subtask 5(points: ): .
- Subtask 6(points: ): .
All testdata satisfy: .
Translated by ChatGPT 5
京公网安备 11011102002149号