#GD0000001. Làm bánh vòng tối đa (Bitter Alchemy)
Làm bánh vòng tối đa (Bitter Alchemy)
Bitter Alchemy
Source: AtCoder
Version: Phuoc Hung OJ Extended
Problem Statement
There are doughnut types. Making one doughnut of type consumes grams of ingredient. You have grams and must make at least one doughnut of every type. Find the maximum total number of doughnuts that can be made.
Input
The first line contains integers . Each of the next lines contains .
Output
Print one integer: the maximum number of doughnuts.
Subtasks
General constraints:
-
.
-
.
-
.
-
Subtask 1 (20 points): ,
-
Subtask 2 (30 points): ,
-
Subtask 3 (50 points): No additional constraints.
Examples
Input
3 1000
120
100
140
Output
9
Explanation
Making one of each type consumes grams, leaving grams. The cheapest type costs grams, so six more can be made. The total is .