#abc205d. [abc205_d]Kth Excluded
[abc205_d]Kth Excluded
Problem Statement
You are given a sequence of positive integers: , and queries.
In the -th query , given a positive integer , find the -th smallest integer among the positive integers that differ from all of .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print lines. The -th line should contain the response to the -th query.
Sample Input 1
4 3
3 5 6 7
2
5
3
Sample Output 1
2
9
4
The positive integers that differ from all of are in ascending order. The second, fifth, and third smallest of them are , , and , respectively.
Sample Input 2
5 2
1 2 3 4 5
1
10
Sample Output 2
6
15