Codeforces Beta Round 40(Div. 2)
B
火星美元
Martian Dollar
Codeforces
1400
原题
← AC →

火星美元AI (CI翻译)

One day Vasya got hold of information on the Martian dollar course in bourles for the next $*n*$ days. The buying prices and the selling prices for one dollar on day $*i*$ are the same and are equal to $*a*_{*i*}$. Vasya has $*b*$ bourles. He can buy a certain number of dollars and then sell it no more than once in $*n*$ days. According to Martian laws, one can buy only an integer number of dollars. Which maximal sum of money in bourles can Vasya get by the end of day $*n*$?

某天,Vasya 获得了未来 $*n*$ 天内火星美元兑布勒的汇率信息。第 $*i*$ 天,一美元的买入价和卖出价相同,均为 $*a*_{*i*}$。Vasya 有 $*b*$ 布勒。他可以购买一定数量的美元,然后在这 $*n*$ 天内最多卖出一次。根据火星法律,只能购买整数数量的美元。Vasya 到第 $*n*$ 天结束时最多可以拥有多少布勒?AI (CI翻译)

Input

输入格式

AI (CI翻译)

The first line contains two integers $*n*$ and $*b*$ ($1 ≤ *n*, *b* ≤ 2000$) — the number of days and the initial number of money in bourles. The next line contains $*n*$ integers $*a*_{*i*}$ ($1 ≤ *a*_{*i*} ≤ 2000$) — the prices of Martian dollars.

第一行包含两个整数 $*n*$ 和 $*b*$($1 ≤ *n*, *b* ≤ 2000$)——天数和初始布勒数量。下一行包含 $*n*$ 个整数 $*a*_{*i*}$($1 ≤ *a*_{*i*} ≤ 2000$)——火星美元的价格。AI (CI翻译)

Output

输出格式

AI (CI翻译)

Print the single number — which maximal sum of money in bourles can Vasya get by the end of day $*n*$.

输出一个整数——Vasya 到第 $*n*$ 天结束时最多可以拥有的布勒数量。 AI (CI翻译)

样例

Input #1
2 4
3 7
Output #1
8
InputCopy OutputCopy
Input #2
4 10
4 3 2 1
Output #2
10
InputCopy OutputCopy
Input #3
4 10
4 2 3 1
Output #3
15
InputCopy OutputCopy
题目信息
题号
41B
时间限制
2 s
内存限制
256 MB
标签
暴力

题面与样例版权归 Codeforces 及出题人所有;中文翻译由 AI 生成(gpt-6.1-sol),如有出入请以原文为准。