You must pack n one-dimensional items into identical bins. Every bin has the same length l, and each item i has length li≤l.
Find the minimum number of bins q such that all of the following hold:
Given the integers n, l, and l1,…,ln, compute the minimum number of bins q.
The first line contains the number of items n (1≤n≤105).
The second line contains the bin length l (1≤l≤10000).
Each of the next n lines contains one item length li (1≤li≤l).
Print a single line containing the minimum number of bins needed to pack all items.
The figure below shows one optimal packing.
