#include<iostream>
#include<utility>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int n,m;cin>>n>>m;
  vector<pair<int,int> > pii(n);

  for(int i=0;i<n;i++)
    cin>>pii[i].first>>pii[i].second;
  sort(pii.begin(),pii.end());
  for(int i=0;i<m;i++){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    int cnt=0;
    for(int j=0;j<n;j++){
      if(x1<=pii[j].first&&pii[j].first<=x2&&y1<=pii[j].second&&pii[j].second<=y2)
	cnt++;
    }
    printf("%d\n",cnt);
  }
  // cout<<ans<<endl;
  return 0;
}


### Prompt

Construct a cpp code solution to the problem outlined:

Taro came to a square to look for treasure. There are many treasures buried in this square, but Taro has the latest machines, so he knows everything about where the treasures are buried. Since the square is very wide Taro decided to look for the treasure to decide the area, but the treasure is what treasure does not know immediately whether or not there in the area for a lot. So Taro decided to count the number of treasures in that area.

Constraints

> 1 ≤ n ≤ 5000
> 1 ≤ m ≤ 5 × 105
> | xi |, | yi | ≤ 109 (1 ≤ i ≤ n)
> | xi1 |, | yi1 |, | xi2 |, | yi2 | ≤ 109 (1 ≤ i ≤ m)
> xi1 ≤ xi2, yi1 ≤ yi2 (1 ≤ i ≤ m)
>

* All inputs are given as integers

Input

> n m
> x1 y1
> x2 y2
> ...
> xn yn
> x11 y11 x12 y12
> x21 y21 x22 y22
> ...
> xm1 ym1 xm2 ym2
>

* n represents the number of treasures buried in the square
* m represents the number of regions to examine
* The 2nd to n + 1 lines represent the coordinates where each treasure is buried.
* The n + 2nd to n + m + 1 lines represent each area to be examined.
* The positive direction of the x-axis represents the east and the positive direction of the y-axis represents the north.
* Each region is a rectangle, xi1 and yi1 represent the coordinates of the southwestern apex of the rectangle, and xi2 and yi2 represent the coordinates of the northeastern apex of the rectangle.

Output

> C1
> C2
> ...
> Cm
>

* Output the number of treasures contained in each area to each line

Examples

Input

3 1
1 1
2 4
5 3
0 0 5 5


Output

3


Input

4 2
-1 1
0 3
4 0
2 1
-3 1 5 1
4 0 4 0


Output

2
1


Input

2 3
0 0
0 0
-1 -1 1 1
0 0 2 2
1 1 4 4


Output

2
2
0


Input

5 5
10 5
-3 -8
2 11
6 0
-1 3
-3 1 3 13
-1 -1 9 5
-3 -8 10 11
0 0 5 5
-10 -9 15 10


Output

2
2
5
0
4

### Response

```cpp
#include<iostream>
#include<utility>
#include<cstdio>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
  int n,m;cin>>n>>m;
  vector<pair<int,int> > pii(n);

  for(int i=0;i<n;i++)
    cin>>pii[i].first>>pii[i].second;
  sort(pii.begin(),pii.end());
  for(int i=0;i<m;i++){
    int x1,y1,x2,y2;
    cin>>x1>>y1>>x2>>y2;
    int cnt=0;
    for(int j=0;j<n;j++){
      if(x1<=pii[j].first&&pii[j].first<=x2&&y1<=pii[j].second&&pii[j].second<=y2)
	cnt++;
    }
    printf("%d\n",cnt);
  }
  // cout<<ans<<endl;
  return 0;
}


```