B - Bitter Alchemy Editorial /

Time Limit: 2 sec / Memory Limit: 256 MB

配点 : 200

問題文

パティシエの赤木さんは、「お菓子の素」という粉のみを材料として N 種類のドーナツを作ることができます。これらのドーナツはドーナツ 1、ドーナツ 2...、ドーナツ N と呼ばれます。ドーナツ i (1 ≤ i ≤ N)1 個作るには、お菓子の素 m_i グラムを消費する必要があります。なお、0.5 個など整数でない個数のドーナツを作ることはできません。

いま、赤木さんはお菓子の素を X グラム持っています。これを使って、今夜のパーティーに向けて可能な限りたくさんのドーナツを作ることにしました。ただし、来客の味の好みは様々なので、次の条件を守ることにしました。

  • N 種類のドーナツそれぞれを少なくとも 1 個は作る。

このとき、最大で何個のドーナツを作ることができるでしょうか?お菓子の素を使い切る必要はありません。また、この問題の制約のもとでは、条件を守ることは必ず可能です。

制約

  • 2 ≤ N ≤ 100
  • 1 ≤ m_i ≤ 1000
  • m_1 + m_2 + ... + m_N ≤ X ≤ 10^5
  • 入力中のすべての値は整数である。

入力

入力は以下の形式で標準入力から与えられる。

N X
m_1
m_2
:
m_N

出力

条件を守って作ることのできるドーナツの最大の個数を出力せよ。


入力例 1

3 1000
120
100
140

出力例 1

9

1000 グラムのお菓子の素があり、赤木さんは 3 種類のドーナツを作ることができます。3 種類すべてのドーナツを 1 個ずつ作ると、120 + 100 + 140 = 360 グラムのお菓子の素を消費します。このとき残る 640 グラムのお菓子の素から、ドーナツ 2 をさらに 6 個作ることができます。以上で合計 9 個のドーナツを作ることができ、これが最大です。


入力例 2

4 360
90
90
90
90

出力例 2

4

4 種類すべてのドーナツを 1 個ずつ作った時点でお菓子の素が尽きます。


入力例 3

5 3000
150
130
150
130
110

出力例 3

26

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