import java.io.*; import java.util.Scanner; public class ss { public static int fact(int n) { int r = 0; n --; while(n > 0) { r += n; n --; } return r; } public static void main(String args[]) throws IOException { Scanner sc = new Scanner(System.in); int i; int days = 0, money = 0; while((i = sc.nextInt()) != 0) { days = i; money = sc.nextInt(); int tmp = 0; int[] prices = new int[days]; float maxRatio = 0; int maxRatioJ = 0; int maxRatioK = 0; boolean ok = false; while(tmp < days) { prices[tmp] = sc.nextInt(); tmp ++; } int min = prices[0]; int pmin = prices[0]; int max = prices[0]; int pmax = prices[0]; for(int k = 1; k < prices.length; k ++) { if(min > prices[k]) { min = prices[k]; max = prices[k]; } else if(max < prices[k]) { max = prices[k]; } if(((float)max / (float)min) > ((float)pmax / (float)pmin)) { pmax = max; pmin = min; } } if(((float)max / (float)min) > 1) { int count = money / min; int cash = money % min; int sell = count * max; System.out.println(sell - money + cash); } else { System.out.println("0"); } } // for(int j = 0; j < ratios.length; j ++) { // System.out.println("ratios[" + j + "] = " + ratios[j] + ""); // } } }