#abc205d. D - Kth Excluded
D - Kth Excluded
Score : points
问题描述
你将获得一个包含 个正整数的序列:,以及 个查询请求。
在第 个查询中 ,给定一个正整数 ,找出与所有 不同的正整数中的第 小的整数。
以上为通义千问 qwen-max 翻译,仅供参考。
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
update @ 2024/3/10 09:18:30