Bin Packing

No attempts yetTime limit1sMemory limit128 MB

Problem

You must pack nn one-dimensional items into identical bins. Every bin has the same length ll, and each item ii has length lill_i \le l.

Find the minimum number of bins qq such that all of the following hold:

  • Each bin contains at most 2 items.
  • Every item is packed into exactly one bin.
  • The total length of the items in any single bin does not exceed ll.

Given the integers nn, ll, and l1,,lnl_1, \dots, l_n, compute the minimum number of bins qq.

Input

The first line contains the number of items nn (1n1051 \le n \le 10^5).

The second line contains the bin length ll (1l100001 \le l \le 10000).

Each of the next nn lines contains one item length lil_i (1lil1 \le l_i \le l).

Output

Print a single line containing the minimum number of bins needed to pack all items.

The figure below shows one optimal packing.