#abc357a. A - Sanitize Hands
A - Sanitize Hands
Score : points
问题陈述
有一瓶消毒液,可以正好消毒 只手。
个外星人依次来消毒他们的手。 第 个外星人()有 只手,想要一次性消毒他们所有的手。
确定有多少外星人可以消毒他们所有的手。 在这里,即使当一个外星人开始消毒时,消毒液不够用以消毒他们所有的手,他们也会用掉剩余的消毒液。
以上为大语言模型 kimi 翻译,仅供参考。
Problem Statement
There is a bottle of disinfectant that can disinfect exactly hands.
aliens come one by one to disinfect their hands.
The -th alien () has hands and wants to disinfect all of their hands once.
Determine how many aliens can disinfect all of their hands.
Here, even if there is not enough disinfectant left for an alien to disinfect all of their hands when they start, they will use up the remaining disinfectant.
Constraints
- All input values are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the number of aliens who can disinfect all of their hands.
Sample Input 1
5 10
2 3 2 5 3
Sample Output 1
3
The aliens disinfect their hands in the following steps:
- The first alien disinfects their two hands. The remaining disinfectant can disinfect hands.
- The second alien disinfects their three hands. The remaining disinfectant can disinfect hands.
- The third alien disinfects their two hands. The remaining disinfectant can disinfect hands.
- The fourth alien has five hands, but there is only enough disinfectant for three hands, so they use up the disinfectant without disinfecting all of their hands.
Thus, the first three aliens can disinfect all of their hands, so print .
Sample Input 2
5 10
2 3 2 3 5
Sample Output 2
4
Sample Input 3
1 5
1
Sample Output 3
1
All aliens can disinfect their hands.