시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 128 MB 9 8 8 88.889%

문제

Bessie and her fellow herd-mates have become extremely territorial. The N (1 <= N <= 400) cows conveniently numbered 1..N have all staked out a grazing spot in the pasture. Each cow i has a spot on an integer grid (0 <= X_i <= 10,000; 0 <= Y_i <= 10,000) and an integer radius R_i that indicates the circle she is staking out (1 <= R_i <= 500).

The cows are a bit greedy and sometimes stake out territory of their herd-mates. For each cow, calculate the number of other cows whose territory overlaps her territory.

By way of example, consider these six cows with indicated locations and radii (don't confuse radius with diameter!):

By visual inspection, we can see and count the overlaps, as shown.

NOTE: the test data will avoid pathological situations like tangents where the circles just barely touch.

입력

  • Line 1: A single integer: N
  • Lines 2..N+1: Three space-separated integers: X_i, Y_i, and R_i

 

출력

  • Lines 1..N: Line i contains a single integer that is the number of other fields that overlap with cow i's field.

 

예제 입력

6
7 7 7
16 14 7
11 13 2
10 17 3
29 8 5
15 7 4

예제 출력

3
4
3
2
0
2

힌트