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

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
   public static void main(String[] args) throws Exception {
        String line;
        BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
        while ((line=reader.readLine())!=null){
            String[] arr=line.split(" ");
            int num=Integer.parseInt(arr[0]);
            int c=Integer.parseInt(arr[1]);
            for (int i = 0; i < num; i++) {
                int power=Integer.parseInt(reader.readLine());
                if(c>=power){
                    c+=power;
                }else {
                    c+=gcd(c,power);
                }
            }
            System.out.println(c);
        }
    }
    public static int gcd(int a,int b){
        int c;
        while ((c=a%b)!=0){
            a=b;
            b=c;
        }
        return b;
    }
}