Variadart


Submit solution


Points: 1
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type
Allowed languages
C, C++, Java, Python

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 n\ (1 \leq n \leq 10^5), the number of darts to be thrown in the game.

The next n lines each contain two integers x_i and y_i (-3\times10^4 \leq x_i,y_i \leq 3\times10^4), the coordinates of the ith dart.

The next line consists of an integer m\ (1 \leq m \leq 10^5),the number of different radius values you will check the score of.

The next m lines each contain some integer r_i\ (1 \leq r \leq 10^4), corresponding to the radius of the ith scoring circle to be checked.

Output

For each of the m 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 r_i 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, (1,0) and (2,1) lie inside, and (0,3) lies on the radius of the circle. For the second query, only (1,0) is valid. For the third query, all darts except the one at (3,3) are valid ((-4,0) is on the boundary and the rest are inside).


Comments

There are no comments at the moment.