#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

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 next

The next line contains an integer

The next

For 100% of the test cases,

## Input

The first line contains an integer*n*representing the number of quicksand spotsThe next

*n*lines contain two integers representing the*x*and*y*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*X*,_{1}*Y*,_{1}*X*and_{2}*Y*, representing the coordinates of the lower left (_{2}*X*,_{1}*Y*) and upper right (_{1}*X*,_{2}*Y*) corner of the rectangle._{2}## Output

Output*f*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

6 1 2 3 2 2 3 2 5 4 4 6 3 4 2 2 4 4 2 2 6 5 3 3 5 6 5 1 6 6

## Sample Output 1

3 4 0 1

## Limits

For 80% of the test cases,*X*<_{1}*X*<2500,_{2}*Y*<_{1}*Y*<2500,_{2}*n*<1000,*f*<1000For 100% of the test cases,

*X*<_{1}*X*<100000,_{2}*Y*<_{1}*Y*<100000,_{2}*n*<300000,*f*<100000### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 100 | 10 | 1s | 128MB | Average |

2 | 0 | 1 | 1s | 128MB | Average |

### Judge Compile Command

g++-7 ans.cpp -o rectangles -Wall -static -O2 -lm -m64 -s -w -std=gnu++17 -fmax-errors=512