#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 60
#define INF 1000000005
#define INFLL (ll)1000000000000000005
#define PI 3.1415926535897
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
#define per(a,mod) ((a)%(mod)+(mod))%(mod)
typedef pair<int,int> P;
const int MAX = (1<<20);
const int MOD = 1000000007;

int dp[N];
void solve(){
    int n;
    cin>>n;
    vector<int>x(n);
    REP(i,n)cin>>x[i];
    map<int,int>t;
    map<int,int>mp[N];
    REP(i,n){
        int tmp=x[i];

        for(int j=2;j*j<=x[i];j++){
            while(tmp%j==0){
                mp[i][j]++;
                tmp/=j;
            }
        }
        if(tmp!=1)mp[i][tmp]++;
        for(auto p:mp[i]){
            t[p.first]++;
        }
    }
    {   
        int j=0;
        for(auto p:t){
            dp[j++]=p.first;
        }
    }
    ll ans=INFLL;
    for(int bits=0;bits<(1<<SZ(t));bits++){
        vector<bool>check(N,0);
        ll tmp=1;
        REP(i,SZ(t)){
            if(bits & (1<<i)){
                REP(j,n){
                    if(mp[j][dp[i]]>0)check[j]=1;
                }
                tmp*=dp[i];
            }
        }
        bool flag=1;
        REP(i,n){
            if(!check[i]){
                flag=0;
                break;
            }
        }
        if(flag){
            ans=min(ans,tmp);
        }

        
    }
    OUT(ans);

}
int main(){
    solve();
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define forn(i,x,n) for(int i = x;i <= n;++i)
#define forr(i,x,n) for(int i = n;i >= x;--i)
#define Angel_Dust ios::sync_with_stdio(0);cin.tie(0)

const int N = 455;
int ans[N],top;
bool st[N];

int main()
{
	int n,k;scanf("%d%d",&n,&k);
	forn(i,1,100 + n)	st[(100 + n) * i / 100] = 1;
	forn(i,1,100 + n - 1)	if(!st[i])	ans[++top] = i;
	printf("%lld\n",ans[k % top == 0 ? top : k % top] + (k / top - (k % top == 0 ? 1 : 0)) * (100ll + n));
    return 0;
}
