#include<bits/stdc++.h>
#define rep(i,a,b) for(ll i=(a);i<=(b);i++)
#define per(i,a,b) for(ll i=(a);i>=(b);i--)
#define next Cry_For_theMoon
typedef unsigned long long ll;
using namespace std;
const ll MAXN=103,INF=2e18;
ll f[MAXN][MAXN][MAXN];
ll n,a[MAXN],sum;
ll x,ans=INF;
ll calc(ll k){
	ll m=(k-(x-sum)%k)%k; //排除的数之和模k为m
	if(k==n){
		if(m)return INF;
		return (x-sum)/k;
	} 
	rep(i,0,n){
		rep(j,0,k){
			f[0][i][j]=INF;
		}
	}
	f[0][0][0]=0;
	rep(i,1,n){
		rep(j,0,n){
			rep(l,0,k){
				f[i][0][l]=INF;
			}
		}
		f[i][0][0]=0;
		rep(j,1,n-k){
			rep(l,0,k-1){
				f[i][j][l]=min(f[i-1][j][l],f[i-1][j-1][(l-a[i]%k+k)%k]+a[i]);
			}
		}
	}
	if(f[n][n-k][m]>1e9)return INF;
	return (x-sum+f[n][n-k][m])/k;
}
int main(){
	cin>>n>>x;
	rep(i,1,n)cin>>a[i],sum+=a[i];
	rep(i,1,n){
		ans=min(ans,calc(i));
	}
	cout<<ans;
	return 0;
}  
/*Jai Shree Ram*/
// Never Give Up
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
 
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define umii            unordered_map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1000000000000000001
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define F(i,s,e,j)        for(int i=s;i<=e;i+=j)
#define mt19937                 rng(chrono::steady_clock::now().tjhe_since_epoch().count());   
//shuffle(arr,arr+n,rng)
 void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}
int a[100];
int dp[100][101][100];
int minim_time(int idx,int n,int s,int k,int left,int x)
{
	if(left==0)
	{

		if((x-s)%k!=0)
			return inf;
		else
			return (x-s)/k;
	}
	if(idx==n)
		return inf;
	if(dp[idx][left][s]!=-1)
		return dp[idx][left][s];
	int op1 = minim_time(idx+1,n,(s+a[idx])%k,k,left-1,x);
    if(op1!=inf+1)
        op1-=(s+a[idx])/k;

	int op2 = minim_time(idx+1,n,s,k,left,x);
	return dp[idx][left][s] = min(op1,op2);
}
int32_t main()
{  
 c_p_c();
 int n,x;
 cin>>n>>x;
 for(int i=0;i<n;i++)
 	cin>>a[i];
 int ans = inf;
for(int k=1;k<=n;k++)
 {
 	memset(dp,-1,sizeof(dp));
 	ans = min(ans,minim_time(0,n,0,k,k,x));
}
 
 cout<<ans<<endl;
} 