You must ferry n people across a river. Each boat can hold at most two people and can carry a combined weight of at most limit. Every person's weight is at most limit, so everyone can travel.
Return the minimum number of boats needed to carry all people.
Input format
Line 1: two integers n and limit.
Line 2: n space-separated integers, the people's weights (present whenever n >= 1).
Output format
A single integer: the minimum number of boats.
Constraints
- 1 <= n <= 100000
- 1 <= limit <= 1000000000
- 1 <= weight[i] <= limit