#abc334d. D - Reindeer and Sleigh
D - Reindeer and Sleigh
Score : points
问题描述
有 辆雪橇,编号为 。
第 辆雪橇需要 只驯鹿来拉动。
另外,每只驯鹿最多只能拉动一辆雪橇。更准确地说,要拉动 辆雪橇 ,需要 只驯鹿。
求解以下形式的 个查询的答案:
- 给定一个整数 ,确定在有 只驯鹿的情况下,最多可以拉动多少辆雪橇。
以上为通义千问 qwen-max 翻译,仅供参考。
Problem Statement
There are sleighs numbered .
reindeer are required to pull sleigh .
Additionally, each reindeer can pull at most one sleigh. More precisely, reindeer are required to pull sleighs .
Find the answer to queries of the following form:
- You are given an integer . Determine the maximum number of sleighs that can be pulled when there are reindeer.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Each query is given in the following format:
Output
Print lines.
The -th line should contain the answer to the -th query.
Sample Input 1
4 3
5 3 11 8
16
7
1000
Sample Output 1
3
1
4
When there are reindeer, sleighs can be pulled.
It is impossible to pull four sleighs with reindeer, so the answer to query is .
Sample Input 2
6 6
1 2 3 4 5 6
1
2
3
4
5
6
Sample Output 2
1
1
2
2
2
3
Sample Input 3
2 2
1000000000 1000000000
200000000000000
1
Sample Output 3
2
0
update @ 2024/3/10 01:21:25