
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.util.StringTokenizer;

public class ss {


	public static class InputItem {
		public int money;
		public int[] prices;

		public InputItem() {

		}

		public boolean read(BufferedReader r) throws Exception {
			String line = r.readLine();
			if (line.startsWith("0"))
				return false;
			StringTokenizer tok = new StringTokenizer(line);
			int days = Integer.parseInt(tok.nextToken());
			money = Integer.parseInt(tok.nextToken());

			line = r.readLine();
			prices = new int[days];
			tok = new StringTokenizer(line);
			for (int i=0; i<prices.length; i++) {
				prices[i] = Integer.parseInt(tok.nextToken());
			}
			return true;
		}
	}

	public static void process(InputItem input) throws Exception {
		int[] maxPrices = new int[input.prices.length];
		int maxPrice = 0;
		for (int i=input.prices.length-1; i>=0; i--) {
			if (input.prices[i]>maxPrice)
				maxPrice = input.prices[i];
			maxPrices[i] = maxPrice;
		}

		int maxProfit = 0;
		int[] prices = input.prices;
		for (int day1 = 0; day1<prices.length-1; day1++) {
			if (maxPrices[day1+1]<=prices[day1]) continue;

			int bought = input.money / prices[day1];
			int profit = bought * (maxPrices[day1+1] - prices[day1]);
			if (profit>maxProfit)
				maxProfit = profit;
		}
		System.out.println(maxProfit);
	}

	public static void main(String[] argv) throws Exception {
		BufferedReader r = new BufferedReader(new InputStreamReader(System.in, "US-ASCII"));
		while (true) {
			InputItem input = new InputItem();
			if (!input.read(r))
				break;
			process(input);
		}

	}
}