[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