100 atcoder#ABC095B. [ABC095B] Bitter Alchemy

[ABC095B] Bitter Alchemy

Score : 200200 points

Problem Statement

Akaki, a patissier, can make NN 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 11, Doughnut 22, ...,..., Doughnut NN. In order to make one Doughnut ii (1iN)(1 \leq i \leq N), she needs to consume mim_i grams of Moto. She cannot make a non-integer number of doughnuts, such as 0.50.5 doughnuts.

Now, she has XX 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 NN 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

  • 2N1002 \leq N \leq 100
  • 1mi10001 \leq m_i \leq 1000
  • m1+m2+...+mNX105m_1 + m_2 + ... + m_N \leq X \leq 10^5
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN XX

m1m_1

m2m_2

::

mNm_N

Output

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

3 1000
120
100
140
9

She has 10001000 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=360120 + 100 + 140 = 360 grams of Moto. From the 640640 grams of Moto that remains here, she can make additional six Doughnuts 22. This is how she can made a total of nine doughnuts, which is the maximum.

4 360
90
90
90
90
4

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

5 3000
150
130
150
130
110
26