Inspections
문제
Benson the Rabbit now has to build a plane!
Benson the Rabbit has a factory with machines numbered from to . Each machine runs for one day and only one machine can run at a time. He has tasks to complete, numbered from to . Each task is represented by two positive integers and where l[i] ≤ r[i].
To complete task , Benson needs to run machines in that order. Once a machine has finished running, the next machine starts immediately. Once task is complete, Benson immediately starts task until task is complete.
In order to comply with safety regulations, the factory must have an safety value . If a machine with safety value was not run in the past or more days, this machine needs to be inspected before it can be run. Machines do not need to be inspected the first time they are run. See the samples for more details.
Benson has different candidate safety values . For each safety value , help him compute the number of inspections that need to be done if the safety value is .
입력
The first line of input will contain spaced integers , and , representing the number of machines, tasks and safety values respectively.
The next lines of input will contain spaced integers each. The -th of these lines will contain and respectively, describing task .
The next line of input will contain spaced integers , which represent the safety values to be tested.
출력
Output one line with spaced integers, the -th integer representing the number of inspections that need to be done if the safety value is .
예제
예제 1
5 3 7 1 3 3 5 2 3 0 1 2 3 4 5 6
3 2 2 2 1 0 0
예제 2
6 6 7 1 6 1 5 1 4 1 3 1 2 1 1 1 2 3 4 5 6 7
15 14 12 9 5 0 0