Fixed Point
题号:NC52772
时间限制:C/C++/Rust/Pascal 1秒,其他语言2秒
空间限制:C/C++/Rust/Pascal 32 M,其他语言64 M
Special Judge, 64bit IO Format: %lld

题目描述

Bobo has a sequence . Initially, holds.
One day, Bobo comes up with infinite operations. The operations are described by m pairs of integers . The i-th operation is to reverse the elements between the -th and the -th. Note that a sequence becomes after reserving the elements between the x-th and the y-th.
Bobo also has q questions . The i-th question is to ask the number of i satisfying if he executes only the first k_i operations. Answer the questions!

输入描述:

The input consists of several test cases and is terminated by end-of-file.
The first line of each test case contains three integers n, m and q.
The i-th of the following m lines contains 2 integers a_i and b_i.
The i-th of the last q lines contains an integer k_i.

输出描述:

For each test case, print q integers which denote the answers.
示例1

输入

复制
5 1 2
2 4
1
2
5 2 1
1 3
3 5
1000000000

输出

复制
3
5
2

备注:

For the first sample, the sequence becomes 1, 4, 3, 2, 5 after the first operation, and becomes 1, 2, 3, 4, 5 after the second one. Thus, the answer are 3, 5 respectively.
*
*
*
*
*
* The number of test cases does not exceed 5.