atcoder#ABC304C. [ABC304C] Virus
[ABC304C] Virus
Score : points
Problem Statement
There are people numbered on a two-dimensional plane, and person is at the point represented by the coordinates .
Person has been infected with a virus. The virus spreads to people within a distance of from an infected person.
Here, the distance is defined as the Euclidean distance, that is, for two points and , the distance between these two points is .
After a sufficient amount of time has passed, that is, when all people within a distance of from person are infected with the virus if person is infected, determine whether person is infected with the virus for each .
Constraints
- if .
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain Yes
if person is infected with the virus, and No
otherwise.
4 5
2 -1
3 1
8 8
0 5
Yes
Yes
No
Yes
The distance between person and person is , so person gets infected with the virus. Also, the distance between person and person is , so person gets infected with the virus. Person has no one within a distance of , so they will not be infected with the virus.
3 1
0 0
-1000 -1000
1000 1000
Yes
No
No
9 4
3 2
6 -1
1 6
6 5
-2 -3
5 3
2 -3
2 1
2 6
Yes
No
No
Yes
Yes
Yes
Yes
Yes
No