import java.util.Scanner;

public class ss {
	public static void main(String[] args)
	{
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		StringBuilder builder = new StringBuilder();
		while (s != 0)
		{
			int l = s;
			int c = sc.nextInt();
			int n;
			int[] ceny = new int[l];
			int max = -1;
			for (int i = 0; i < l; i++)
			{
				ceny[i] = sc.nextInt();
			}
			for (int i = 0; i < (l - 1); i++)
			{
				if (i > 0)
				{
					if ((ceny[i - 1] < ceny[i]) && (ceny[i] > ceny[i - 1]))
						continue;
				}
				n = c / ceny[i];
				for (int j = i + 1; j < l; j++)
				{
					if ((n * (ceny[j] - ceny[i])) > max)
						max = n * (ceny[j] - ceny[i]);
				}
			}
			if (max > 0)
				builder.append(max);
			else
				builder.append("0");
			builder.append("\n");

			s = sc.nextInt();
		}
		System.out.print(builder);
	}
	
}
