13606 - Sprinklers   

Description

Katex

To maintain the flourish of the NTHU great lawn, there are some automatic sprinklers installed on the lawn.

Specifically, there are \(N\) automatic sprinklers, the \(ith\) one is installed at the position \((x[i], y[i])\) with the range \(r[i]\) -- meaning that it can water the grass inside the circle of radius \(r[i]\) centered at \((x[i], y[i])\)

For it may hurt the grass if it has been watered too much, the Director of General Affairs, \(DYY\), wants to know if some sprinklers' ranges are intersecting with any other sprinkler. So \(\forall i \in [1, N]\), you should print \(1\) if the \(ith\) sprinkler is intersecting with some other sprinkler, or print \(0\) otherwise.

Since programming is so trivial for \(DYY\) that it is such an abasement to do it himself, \(DYY\) asks you to do it for him.

And he will plus \(0.2\) points to your final score in return.

Hint 1: sprinklers \( i, j \) are intersecting if and only if \( (x[i]-x[j])^2+(y[i]-y[j])^2 < (r[i]+r[j])^2 \)

Hint 2: You may want to use the "sqrt()" function in math.h library, though I personally not recommend to use it in this problem for its precision problem.

Hint 3: All the discrete system is trivial, only calculus is the real technique, said \(DYY\).

Hint 4: There's no further hint.

Input

The first line of input contains an integer N, which is guaranteed to be less than or equal to 3000.

The following N lines, each contains 3 integers x[i], y[i], r[i].

It is guaranteed that 1 <= x[i], y[i], r[i] <= 109 

Output

For each sprinkler, you should print that whether it is intersecting with some other sprinkler or not.

Print your answer in one line, separated with single space character.

Please remember to print '\n' at the end.

Sample Input  Download

Sample Output  Download

Tags

LoseLightLight



Discuss