OpenJudge

07:Ninja props

总时间限制:
1000ms
内存限制:
65536kB
描述

You have N Ninja props, and the weight of each prop is C1, C2 ... CN, respectively. Now you want to put the N props into some same prop bags. The capacity of one prop bag is W. So how many prop bags you need at least?  

输入
The first line contains two integers N and W.
For the next N lines, each line is an integer, representing the weight of the i_th prop.
输出
An integer, representing the minimum number of prop bags.
样例输入
5 1996
1
2
1994
12
29
样例输出
2
提示
1<=N<=18,1<=Ci<=W<=10^8.

01 Use "long long" to calculate the answer
05 Expected Value of an Expression: Ai is less than 2^20

全局题号
15300
提交次数
80
尝试人数
27
通过人数
5