LearnPy Hub
← Arena
IntermediateRating 1300

Boats

Each boat carries at most 2 people with total weight ≤ limit. Print the minimum number of boats.

Input

n limit, then n weights (each ≤ limit).

Output

A count.

Sample 1

Input
4 3
3 2 2 1
Output
3

Sample 2

Input
2 3
1 2
Output
1
solution.py
Output appears here
Boats · Python Arena problem · LearnPy Hub