Processing math: 100%
Packing - MarisaOJ: Marisa Online Judge

Packing

Time limit: 1000 ms
Memory limit: 256 MB
Marisa got n unused items, and she decided to put them in some boxes. The ith item weighs wi. Knowing each box can withstand a weight of W, what's the minimum number of boxes does she need to use? ### Input - The first line contains 2 integers n,W. - The second line contains n integers wi. ### Output - Print the minimum number of boxes she need. ### Constraints - 1≤n≤20. - 1≤Ai≤W≤109. ### Example Input: 451234 Output: 2