After his new game idea was finally solved, returns home from school and unwinds in his room for the rest of the evening. He was in the middle of downloading more Rem when his phone rang. It was his old friend, who had called to ask for advice on his side project!
In Slither.io, the player is a snake who tries to survive in a world of legless reptiles. Because one dies in the event of a head-on collision with another player,is tasked with implementing a component of the path-finding algorithm which actively seeks to avoid such collisions.
The current instance of time in the game contains other players, representing the points which the player character wants to avoid. However, the player has instances of the game open and as a result, must update the game-state for their path-finding.
The opposing snakes and the queried snakes are represented by an ordered pair in the Cartesian plane.
For each of the queried snakes controlled by the player, must determine the squared distance of the nearest point from the opposing points , and the number of those points which have a squared distance equal to .
Can you write a program to helphelp his friend?
The first line of the input will contain a single integer , denoting the number of opposing snakes to consider.
The next lines will each contain two space-separated integers , representing the location of the opponent.
The next line will contain a single integer , denoting the number of Slither.io games the player is playing simultaneously.
The next lines will each contain two space-separated integers , representing the location of the player character.
Subtask #1 [20%]
Subtask #2 [80%]
Your program should output two space-separated integers on a single line for each of the queries.
The first integer represents the square of the Euclidean distance between the queried point and the closest of the snakes.
The second integer represents the number of points from the set of opponents whose squared distance from the queried point is equal to .
3 0 0 98 0 100 0 2 1 0 49 0
1 1 2401 2