#abc357a. A - Sanitize Hands

A - Sanitize Hands

Score : 100100 points

问题陈述

有一瓶消毒液,可以正好消毒 MM 只手。

NN 个外星人依次来消毒他们的手。 第 ii 个外星人(1iN1 \leq i \leq N)有 HiH_i 只手,想要一次性消毒他们所有的手。

确定有多少外星人可以消毒他们所有的手。 在这里,即使当一个外星人开始消毒时,消毒液不够用以消毒他们所有的手,他们也会用掉剩余的消毒液。

以上为大语言模型 kimi 翻译,仅供参考。

Problem Statement

There is a bottle of disinfectant that can disinfect exactly MM hands.

NN aliens come one by one to disinfect their hands.
The ii-th alien (1iN1 \leq i \leq N) has HiH_i 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

  • 1N,M1001 \leq N, M \leq 100
  • 1Hi1001 \leq H_i \leq 100
  • All input values are integers.

Input

The input is given from Standard Input in the following format:

NN MM

H1H_1 H2H_2 \ldots HNH_N

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 102=810-2=8 hands.
  • The second alien disinfects their three hands. The remaining disinfectant can disinfect 83=58-3=5 hands.
  • The third alien disinfects their two hands. The remaining disinfectant can disinfect 52=35-2=3 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 33.

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.