Crop Circles
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
64bit IO Format: %lld

题目描述

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.

输入描述:

* 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.
示例1

输入

复制
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