[GCOI Round #1 D] Mission
题目描述
Mr Aoligei has \(n\) missions. He played most of the time, so the deadline of aool the missions is only \(d\) days away. For the i-th mission, he must spend \(a_i\) days to do it. Now, you need to tell him how many missions can he do before the deadline. He cannot do more than one mission at a time.
输入格式
Input is given from Standard Input in the following format:
\(n \space \space d \newline a_1 \space \space a_2 \space \space \dots \space \space a_d\)
输出格式
Print the number of mission he can do before the deadine.
输入输出样例
Input #1:
5 3
2 1 4 3 1
Output #1:
2
相关
在下列比赛中: