AtCoder Beginner Contest 095
B
Bitter Alchemy
AtCoder
⌀ 0
原题
← AC →
翻译中…

Problem Statement

翻译中…

Akaki, a patissier, can make $N$ kinds of doughnut using only a certain powder called "Okashi no Moto" (literally "material of pastry", simply called Moto below) as ingredient. These doughnuts are called Doughnut $1$, Doughnut $2$, $...,$ Doughnut $N$. In order to make one Doughnut $i$ $(1 ≤ i ≤ N)$, she needs to consume $m_i$ grams of Moto. She cannot make a non-integer number of doughnuts, such as $0.5$ doughnuts.

翻译中…

Now, she has $X$ grams of Moto. She decides to make as many doughnuts as possible for a party tonight. However, since the tastes of the guests differ, she will obey the following condition:

翻译中…
  • For each of the $N$ kinds of doughnuts, make at least one doughnut of that kind.
翻译中…

At most how many doughnuts can be made here? She does not necessarily need to consume all of her Moto. Also, under the constraints of this problem, it is always possible to obey the condition.

翻译中…

Constraints

翻译中…
  • $2 ≤ N ≤ 100$
  • $1 ≤ m_i ≤ 1000$
  • $m_1 + m_2 + ... + m_N ≤ X ≤ 10^5$
  • All values in input are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N X
m_1
m_2
:
m_N

翻译中…

Output

翻译中…

Print the maximum number of doughnuts that can be made under the condition.

翻译中…

样例

Input #1
3 1000
120
100
140
Output #1
9
She has $1000$ grams of Moto and can make three kinds of doughnuts. If she makes one doughnut for each of the three kinds, she consumes $120 + 100 + 140 = 360$ grams of Moto. From the $640$ grams of Moto that remains here, she can make additional six Doughnuts $2$. This is how she can made a total of nine doughnuts, which is the maximum.
Input #2
4 360
90
90
90
90
Output #2
4
Making one doughnut for each of the four kinds consumes all of her Moto.
Input #3
5 3000
150
130
150
130
110
Output #3
26
题目信息
题号
abc095_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。