#abc234d. D - Prefix K-th Max
D - Prefix K-th Max
Score : points
问题描述
已知一个由 的排列 和一个正整数 。
对于每个 ,找出以下内容:
- 在 的前 项中第 大的值。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
Given are a permutation of and a positive integer .
For each , find the following.
- The -th greatest value among the first terms of .
Constraints
- is a permutation of .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
For each , in this order, print the specified value in Problem Statement, separated by newlines.
Sample Input 1
3 2
1 2 3
Sample Output 1
1
2
- The -nd greatest value among the first terms of , , is .
- The -nd greatest value among the first terms of , , is .
Sample Input 2
11 5
3 7 2 5 11 6 1 9 8 10 4
Sample Output 2
2
3
3
5
6
7
7
update @ 2024/3/10 10:10:04