#abc106d. [abc106_d]AtCoder Express 2

[abc106_d]AtCoder Express 2

Problem Statement

In Takahashi Kingdom, there is a east-west railroad and NN cities along it, numbered 11, 22, 33, ..., NN from west to east. A company called AtCoder Express possesses MM trains, and the train ii runs from City LiL_i to City RiR_i (it is possible that Li=RiL_i = R_i). Takahashi the king is interested in the following QQ matters:

  • The number of the trains that runs strictly within the section from City pip_i to City qiq_i, that is, the number of trains jj such that pileqLjp_i \\leq L_j and RjleqqiR_j \\leq q_i.

Although he is genius, this is too much data to process by himself. Find the answer for each of these QQ queries to help him.

Constraints

  • NN is an integer between 11 and 500500 (inclusive).
  • MM is an integer between 11 and 200000200 \\ 000 (inclusive).
  • QQ is an integer between 11 and 100000100 \\ 000 (inclusive).
  • 1leqLileqRileqN1 \\leq L_i \\leq R_i \\leq N (1leqileqM)(1 \\leq i \\leq M)
  • 1leqpileqqileqN1 \\leq p_i \\leq q_i \\leq N (1leqileqQ)(1 \\leq i \\leq Q)

Input

Input is given from Standard Input in the following format:

NN MM QQ L1L_1 R1R_1 L2L_2 R2R_2 :: LML_M RMR_M p1p_1 q1q_1 p2p_2 q2q_2 :: pQp_Q qQq_Q

Output

Print QQ lines. The ii-th line should contain the number of the trains that runs strictly within the section from City pip_i to City qiq_i.


Sample Input 1

2 3 1
1 1
1 2
2 2
1 2

Sample Output 1

As all the trains runs within the section from City 11 to City 22, the answer to the only query is 33.


Sample Input 2

10 3 2
1 5
2 8
7 10
1 7
3 10

Sample Output 2

1
1

The first query is on the section from City 11 to 77. There is only one train that runs strictly within that section: Train 11. The second query is on the section from City 33 to 1010. There is only one train that runs strictly within that section: Train 33.


Sample Input 3

10 10 10
1 6
2 9
4 5
4 7
4 7
5 8
6 6
6 7
7 9
10 10
1 8
1 9
1 10
2 8
2 9
2 10
3 8
3 9
3 10
1 10

Sample Output 3

7
9
10
6
8
9
6
7
8
10