#GD0000015. Ổ USB (USB Flash Drives)
Ổ USB (USB Flash Drives)
USB Flash Drives
Source: Codeforces
Version: Phuoc Hung OJ Extended
Problem Statement
There are USB drives, where drive has capacity MB. A file of size MB may be split among drives. Find the minimum number of drives needed.
Input
The first line contains . The second line contains . Each of the next lines contains one capacity .
Output
Print the minimum number of drives needed.
Subtasks
General constraints:
-
.
-
.
-
.
-
.
-
Subtask 1 (20 points): ,
-
Subtask 2 (30 points): ,
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
3
5
2
1
3
Output
2
Explanation
The drives of capacities and total exactly MB, so two drives suffice; no single drive has enough capacity.