#include<iostream>

using namespace std;

int main()
{
  while (true)
  {
    long long days, money;
    cin >> days;
    if (days == 0) break;
    cin >> money;
    long long minprice = 100000, maxprofit = 0;
    for (int i = 0; i < days; i++)
    {
      long long price;
      cin >> price;
      if (price < minprice)
	minprice = price;
      long long pieces, profit;
      pieces = money/minprice;
      profit = pieces * price - pieces * minprice;
      if (profit > maxprofit)
	maxprofit = profit;
      
    }
    cout << maxprofit << endl;
      
  }
}