#ds301. 二维数点
二维数点
2D Range Counting
Problem Description
There are points on the plane.
Answer queries. Each query gives a rectangle and asks how many points lie inside the rectangle.
Input Format
The first line contains two integers ().
The next lines each contain two integers ().
The next lines each contain four integers ($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