Little Joseph wants to build random rectangular areas with fences. However, there are certain spots with quicksand, and that is not good for putting a fence there, hence jeopardizing the safety of the area. Hence, Little Joseph wants to find out how many quicksand spots the fence will be built on for his randomly chosen coordinates for rectangular areas.
The first line contains an integer n
representing the number of quicksand spots
The next n
lines contain two integers representing the x
coordinates of the quicksand spots.
The next line contains an integer f
representing the number of rectangles.
The next f
lines contains four integers each X1
, representing the coordinates of the lower left (X1
) and upper right (X2
) corner of the rectangle.
integers, one per line, the number of quicksand spots that the fence will be built on for each rectangle in the order they are presented in the input.
Sample Input 1
2 2 4 4
2 2 6 5
3 3 5 6
5 1 6 6
Sample Output 1
For 80% of the test cases, X1
For 100% of the test cases, X1