The computer is greater and greater now.
You can imagine that a computer with countless
cores. That will be Greeeeeat!
So the computer can deal with tasks continuous
but not cut into small ones.
Give you N tasks and its start time and end time.
Each core can only deal with one task at a moment and the tasks should not be
cut into small ones. The problem will ask you several questions that how many
cores are at work at moment T.
This problem contains several cases. Input until EOF.
The first line of each case contains an integer N (1 <= N <= 500000), stand for the number of tasks.
Then follows N lines, each line stands for a task. It contains the ith task's start time and end time. (0 <= starttime <= endtime <= 5000000).
Then it will be an integer Q (1 <= Q <= 500000), stands for the number of questions.
Next Q lines, each line is an integer q (0 <= q <= max (endtime)), stands for the moment that you're asked.
For each question, you should output how many cores are at work at that moment. Each question per line.