#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORe(i,a,b) for(int i=a;i<=b;i++)
#define FORr(i,a,b) for(int i=a;i>b;i--)
#define FORre(i,a,b) for(int i=a;i>=b;i--)
#define pb push_back
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


void solve(){
    ll n,x; cin >> n >> x;
    ll ans = x;
    vector<ll> a(n); rep(i,0,n) cin >> a[i];
    for(int k = 1; k <= n; k++){
        vector<vector<int> >dp(k+1,vector<int>(k,-1));
        dp[0][0] = 0;
        for(ll v : a){
            for(int c = k - 1; c >= 0; c--){
                for(int r = 0; r < k; r++){
                    if(dp[c][r] == -1) continue;
                    int next = dp[c][r] + v;
                    dp[c+1][next%k] = max(dp[c+1][next%k],next);
                }
            }
        }
        int start = dp[k][x%k];
        if(start == -1) continue;
        ans = min(ans,(x-start)/k);
    }
    cout << ans << endl;
}

int main(){
        ios::sync_with_stdio(0);
	    cin.tie(0);
        int t = 1;
        // cin >> t;
        while(t--){
            solve();
        }
        return 0;
}
#include<cstdio>
#include<cstring>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef int int_;
#define int long long
#define maxn 400010
const int inf=1e9+7;
queue<int> q;
inline int read(){
	int ret=0,ff=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') ff=-ff;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		ret=ret*10+ch-'0';
		ch=getchar();
	}
	return ret*ff;
}
struct Edge{
	int u,v,w,next;
}E[maxn<<1];
int ecnt=0,head[maxn];
int in[maxn];
void addedge(int u,int v){
	++in[v];
	E[++ecnt].u=u;
	E[ecnt].v=v;
	E[ecnt].next=head[u];
	head[u]=ecnt;
}
void Addedge(int u,int v){
	addedge(u,v);
	addedge(v,u);
}
int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}
int ksm(int a,int b,int p){
	int ret=1;
	while(b){
		if(b&1) ret=ret*a%p;
		a=a*a%p;
		b>>=1;
	}
	return ret%p;
}
bool cmp(int x,int y){
	return x>y;
}
int a[10010];
int G2(int x){
	int cnt=0;
	while(x){
		a[++cnt]=x%10;
		x/=10;
	}
	sort(a+1,a+1+cnt);
	int ret=0;
	for(int i=1;i<=cnt;++i) ret=ret*10+a[i];
	return ret;
}
int G1(int x){
	int cnt=0;
	while(x){
		a[++cnt]=x%10;
		x/=10;
	}
	sort(a+1,a+1+cnt,cmp);
	int ret=0;
	for(int i=1;i<=cnt;++i) ret=ret*10+a[i];
	return ret;
}
int F(int x){
	return G1(x)-G2(x);
}
char X[10010];
bool ck(int Mid,int len,int m){
	int sum=0,tmp=1;
	for(int j = len; j;--j){
		sum+=tmp*(X[j]-'0');
		tmp*=Mid;		
	}
	return sum>m;
}
int dp[2][110][110][110];
int_ main(){
	int n=read(),x=read();
	for(int i=1;i<=n;++i) a[i]=read();
	memset(dp, -1, sizeof dp);
	for(int i=1;i<=n;i++) dp[0][i][0][0] = 0;
	for(int i=0;i<n;i++){
		int qwq=i&1;
		for(int j =1;j<=n;j++){
			for(int qaq =0;qaq<=i;qaq++){
				for(int res=0;res<j;res++){
					if(dp[qwq][j][qaq][res]==-1) continue;
					dp[qwq^1][j][qaq+1][(res+a[i+1])%j]=max(dp[qwq^1][j][qaq+1][(res+a[i+1])%j],dp[qwq][j][qaq][res]+a[i+1]);
					dp[qwq^1][j][qaq][res]=max(dp[qwq^1][j][qaq][res], dp[qwq][j][qaq][res]);
				}
			}
		}
	}
	int qwq=n&1,ans=x;
	for(int qaq=1;qaq<=n;qaq++){
		if(dp[qwq][qaq][qaq][x%qaq]>0&&x>=dp[qwq][qaq][qaq][x%qaq])ans=min(ans,(x-dp[qwq][qaq][qaq][x%qaq])/qaq);	
	}
	printf("%lld",ans);
	return 0;
}
/*
1
6 3
*/
/*
111111111111111111111111111111111111111111111111111111111111
1000000000000000000

100000000000000000000000000000000000000000000000000000000000

1000000000000000000
2
1000000000000000000
*/