Question
Emergency Rescue Boats
During a flood rescue operation,
Find the minimum number of boats needed to rescue everyone.
Input
The first line contains two integers KaTeX can only parse string typed expression and KaTeX can only parse string typed expression.
The second line contains KaTeX can only parse string typed expression integers — the weights of the people.
Output
Print a single integer — the minimum number of boats required.
Example
Example 1:
Input
Example 2:
Input
Input
4 100
40 50 60 70Output3Example 2:
Input
4 3
1 2 2 3Output3