#ds301. 二维数点

二维数点

2D Range Counting

Problem Description

There are nn points (xi,yi)(x_i, y_i) on the plane.

Answer qq queries. Each query gives a rectangle [X1,X2]×[Y1,Y2][X_1, X_2] \times [Y_1, Y_2] and asks how many points lie inside the rectangle.

Input Format

The first line contains two integers n,qn, q (1≤n,q≤2×1051\leq n, q\leq 2\times 10^5).

The next nn lines each contain two integers xi,yix_i, y_i (1≤xi,yi≤1091\leq x_i, y_i \leq 10^9).

The next qq lines each contain four integers X1,X2,Y1,Y2X_1, X_2, Y_1, Y_2 ($1\leq X_1 \leq X_2 \leq 10^9,\ 1\leq Y_1 \leq Y_2 \leq 10^9$).

Output Format

For each query, output one number, the answer.

Sample Input

5 5
1 3
2 5
3 2
4 4
5 1
1 5 1 5
2 4 3 5
1 3 2 5
100 100 100 100
1 1 3 3

Sample Output

5
2
3
0
1