100951: [AtCoder]ABC095 B - Bitter Alchemy

Memory Limit:256 MB Time Limit:2 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

Score : $200$ points

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.


Sample Input 1

3 1000
120
100
140

Sample 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.


Sample Input 2

4 360
90
90
90
90

Sample Output 2

4

Making one doughnut for each of the four kinds consumes all of her Moto.


Sample Input 3

5 3000
150
130
150
130
110

Sample Output 3

26

Input

题意翻译

糕点师 Akaki 可以制作 $n$ 种不同的蛋糕,第 $i$ 种蛋糕需要 $a_i$ 克的面团。 今天晚上有客人到访,于是 Akaki 决定为客人们制作蛋糕。现在一共有 $m$ 克面团用于制作蛋糕。客人们要求**每种蛋糕都至少要做一个**,求 Akaki 最多能够做多少个蛋糕。 数据范围:$2\leqslant n\leqslant 100$,$1\leqslant a_i\leqslant 1000$,$\sum a_i\leqslant m\leqslant 10^5$,所有输入的数据都是整数。 Translated by Eason_AC 2021.7.16

加入题单

算法标签: