5277: Rocket land

内存限制:128 MB 时间限制:120.000 S
评测方式:文本比较 命题人:
提交:27 解决:4

题目描述

There are n rockets launched to a plain, which can be regarded as a two-dimensional plane.The rockets land in sequence.The i-th rocket will bring up smoke when it lands. The range is a circle with radius ri.if the smoke cover the j-th rocket, it will cause the loss of vj.How much loss does each rocket cause.
 

输入

The first line contains an integer T(1≤T≤5)representing the number of test cases.
For each test case, the first line contains an integer n(1≤n≤2∗105) representing the number of the rockets.
the next n line followed. the i−th line contains the coordinates of the i−th rocket xi,yi(−109≤xi,yi≤109), the loss when it is covered vi(1≤vi≤109), and the range of smoke ri (0≤ri≤109).
It is guaranteed that there are no more than 1 testcases with n>105
The rocket may land at the same coordinates
all test cases create by randomly

输出

For each test case, print n line representing the loss caused by i-th rocket.

样例输入 复制

1
5
1 1 1 3
2 2 2 1
3 3 4 2
4 4 8 2
5 5 16 4

样例输出 复制

1
2
6
12
28

提示

oj判题上限300s,这标程需要115s左右