| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 2 초 (추가 시간 없음) | 2048 MB | 39 | 19 | 19 | 54.286% |
You are given $n$ disks in the plane. The center of each disk has integer coordinates, and the radius of each disk is a positive integer. No two disks overlap in a region of positive area, but it is possible for disks to be tangent to each other.
Your task is to determine whether it is possible to change the radii of the disks in such a way that:
The new radii are allowed to be arbitrary positive real numbers. The centers of the disks cannot be changed.
The first line contains an integer $n$ ($1 ≤ n ≤ 1000$) — the number of disks.
The next $n$ lines contain three integers each. The $i$-th of such lines contains $x_i$, $y_i$ ($-10^9 ≤ x_i , y_i ≤ 10^9$), and $r_i$ ($1 ≤ r_i ≤ 10^9$) — the coordinates of the center, and the radius, of the $i$-th disk.
Print YES if it is possible to change the radii in the desired manner. Otherwise, print NO.
5 0 2 1 0 0 1 4 -3 4 11 0 3 11 5 2
YES
One can decrease the radii of the first and third disk by $0.5$, and increase the radius of the second disk by $0.5$. This way, the sum of all radii decreases by $0.5$. The situation before and after changing the radii is depicted below.
First sample (left) and a valid way to change the radii of the disks (right).
4 2 2 2 7 2 3 7 7 2 2 7 3
NO
Depicted below, there is no way to change the radii of the disks in the desired manner.
Second sample.