import java.io.*;
import java.util.*;

public class ss{

	BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
	StringTokenizer st = new StringTokenizer("");
	
	public boolean run() throws IOException{
		int n = nextInt();
		if (n != 0){
				
				int money = nextInt();
				int prices[] = new int[n];
				for(int i = 0; i < n;i++){
					prices[i] = nextInt();		
				}
				int pocet = 0, max = 0, pom = 0;;
				for(int i = 0; i < n;i++){
					max = 0;
					pocet = (int)(money / prices[i]);
					if (pocet != 0){
						for(int j = i; j < n;j++){
							if (max < (prices[j] - prices[i])){
								max = prices[j] - prices[i];
							}	
						}
					}
					max = max * pocet;
					if (pom < max) pom = max;
				}
				System.out.println(pom);
				return true;
		}else return false;
	}

	public String nextToken() throws IOException{
		while(!st.hasMoreTokens()) st = new StringTokenizer(stdin.readLine());
		return st.nextToken();
	}

	public int nextInt() throws IOException{
		return Integer.parseInt(nextToken());	
	}	

	public static void main(String[] argv) throws IOException{
		ss m = new ss();	
		while(m.run()){}
	}
}
