AT_past17_j カフェ
Description
$ N $ customers visited a cafe: customer $ 1 $ , customer $ 2 $ , $ \ldots $ , and customer $ N $ .
For $ i = 1, 2, \ldots, N $ , customer $ i $ stayed in the cafe from time $ A_i $ to time $ B_i $ (including time $ A_i $ and time $ B_i $ ).
No customers other than these $ N $ visited the cafe.
For each of $ Q $ times $ t_1, t_2, \ldots, t_Q $ , find the number of customers who were staying in the cafe at that time.
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ A_1 $ $ B_1 $ $ A_2 $ $ B_2 $ $ \vdots $ $ A_N $ $ B_N $ $ Q $ $ t_1 $ $ t_2 $ $ \vdots $ $ t_Q $
Output Format
Print $ Q $ lines. For $ i = 1, 2, \ldots, Q $ , the $ i $ -th line should contain the number of customers who were staying in the cafe at time $ t_i $ .
Explanation/Hint
### Sample Explanation 1
- At time $ 1 $ , no one was in the cafe.
- At time $ 2 $ , one customer was in the cafe: customer $ 1 $ .
- At time $ 3 $ , two customers were in the cafe: customers $ 1 $ and $ 3 $ .
- At time $ 4 $ , four customers were in the cafe: customers $ 1 $ , $ 2 $ , $ 3 $ , and $ 4 $ .
- At time $ 5 $ , three customers were in the cafe: customers $ 2 $ , $ 3 $ , and $ 4 $ .
- At time $ 6 $ , one customer was in the cafe: customer $ 3 $ .
- At time $ 7 $ , no one was in the cafe.
### Constraints
- $ 1 \leq N, Q \leq 2 \times 10^5 $
- $ 1 \leq A_i \lt B_i \leq 10^9 $
- $ 1 \leq t_i \leq 10^9 $
- All input values are integers.