Олимпиадный тренинг

Задача 29468. Socks


There is a table of length L. N socks are laid out on the table so that no sock gets out of the table. Next, there is a smart boy Vasyok who wants (purely for selfish purposes) to measure the thickness of the table covering with socks at M points.
 
Input
In the input file, L, N, M are given first (1 ≤ L ≤ 10000, 1 ≤ N ≤ 10000, 1 ≤ M ≤ 100000).
 
Next are N pairs of numbers l ≤ r from 1 to L – left and right ends of socks.
 
Then there are M numbers from 1 to L points of interest to Vaska.
 
Output
Print M numbers – the thickness of the toe cap at each point.
 
Input Output
39 4 7
3 21
3 15
2 20
3 17
4
17
33
5
9
25
37
4
3
0
4
4
0
0

Запрещенные операторы:sort