Variadart
You and your friend have had a night out and are now thinking about how the game of darts would be if the board size were variable, such that the game could cater to different skill levels.
To test out your new idea, you have gotten an infinite 2D plane of paper to use as your dartboard. You throw some amount of darts at the board. Then, you see what score you would have gotten if the dartboard scoring radius had been different values, so you and your friend can see the usefulness of your idea.
Input
The first line consists of an integer , the number of darts to be thrown in the game.
The next lines each contain two integers
and
, the coordinates of the
th dart.
The next line consists of an integer ,the number of different radius values you will check the score of.
The next lines each contain some integer
, corresponding to the radius of the
th scoring circle to be checked.
Output
For each of the dartboard radii, output the number of darts which lie within the scoring area. That is, output the amount of darts whose coordinates are within or on the boundary of the circle with radius
around the origin.
Example
Input 1
5
1 0
2 1
3 3
-4 0
0 3
4
3
2
4
5
Output 1
3
1
4
5
For the first circle, and
lie inside, and
lies on the radius of the circle. For the second query, only
is valid. For the third query, all darts except the one at
are valid (
is on the boundary and the rest are inside).
Comments