#P3415. Ferris Wheel

Ferris Wheel

当前没有测试数据。

Description

There are n children who want to go to a Ferris wheel, and your task is to find a gondola for each child.

Each gondola may have one or two children in it, and in addition, the total weight in a gondola may not exceed x. You know the weight of every child.

What is the minimum number of gondolas needed for the children?

Input Format

The first input line contains two integers n and x: the number of children and the maximum allowed weight.

The next line contains n integers p1,p2,,pn: the weight of each child.

Output Format

Print one integer: the minimum number of gondolas.
4 10
7 2 3 9
3

Hint

<li> 1n2105 </li> <li> 1x109 </li> <li> 1pix </li>

Source

CSES