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

#define ll long long int
#define absdiff(a,b) (a>b)?a-b:b-a
#define mp make_pair 
#define pb push_back
#define ff first
#define ss second
#define fast  ios_base::sync_with_stdio(false);cin.tie(0);
#define MOD 1000000007 
#define ll_MAX 1922337203685912
#define endl "\n"
ll fast_expo(ll x,ll p){
  if(p==0) return 1;
  else if(p%2==0){ ll t=fast_expo(x,p/2)%MOD;return (t*t)%MOD;} 
  else return (x*(fast_expo(x,p-1))%MOD)%MOD;}
ll invMod(ll num){
  return fast_expo(num, MOD - 2)%MOD;
}

const ll N = 1e2 + 5;
ll dp[N][N][N];

int main(){
  fast
  #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
  #endif
  
  ll t_c; t_c = 1;
//   cin >> t_c;

  for(ll t_i = 0; t_i < t_c; ++t_i){
    ll n, x; cin >> n >> x;
    ll arr[n + 1]{};
    memset(dp, -1, sizeof(dp));
    for(ll i = 1; i <= n; ++i)
        cin >> arr[i];


    for(ll i = 1; i <= n; ++i){ // final number of elements
        dp[i][0][0] = 0;
        for(ll j = 1; j <= n; ++j){  // current index of element
            for(ll k = j; k >= 0; --k){   // current size of elements
                for(ll m = 0; m < i; ++m){     //  current mod value
                    if(dp[i][k][m] == -1)
                        continue;
                    ll val = dp[i][k][m] + arr[j];
                    dp[i][k + 1][val%i] = max(dp[i][k + 1][val%i], val);
                }
            }

        }
    }

    ll ans = LLONG_MAX;
    for(ll i = 1; i <= n; ++i){
        ll val = x%i;

        if(dp[i][i][val] == -1)
            continue;

        ll diff = (x - dp[i][i][val])/i;
        ans = min(ans, diff);
    }

    cout << ans;
  } 
  return 0;
}

#include<queue>
#include<iostream>
#include<math.h>
#include<stdlib.h>
#include<string>
#include<limits.h>
#include<utility>
#include<vector>
#include<tuple>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for(ll i=0;i<n;i++)
#define ALL(A) A.begin(),A.end()

struct UnionFind{
    vector<ll> par;
    UnionFind(ll N):par(N){
        rep(i,N){
            par[i]=i;
        }
    }
    ll root(ll x){
        if(par[x]==x)return x;
        return par[x]=root(par[x]);
    }
    void unite(ll x,ll y){
        ll rx=root(x);
        ll ry=root(y);
        if(rx==ry){
            return;
        }
        par[rx]=ry;
    }
    bool same(ll x, ll y){
        ll rx=root(x);
        ll ry=root(y);
        return rx==ry;
    }

};
long long GCD(long long a, long long b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}
long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x);
    y -= a/b * x;
    return d;
}
int main(){
    ll n,x;
    cin>>n>>x;
    vector<ll> a(n);
    rep(i,n)cin>>a[i];
    ll ans=LLONG_MAX;
    rep(i,n+1){
        if(i==0)continue;
        //                              i                        n            mod
        vector<vector<vector<ll> > > dp(i+1,vector<vector<ll> > (n+1,vector<ll>(i,-1)));
        dp[0][0][0]=0;
        rep(j,i){
            rep(k,n){
                //cout<<i<<j<<k<<endl;
                rep(l,i){
                    
                    //if(i==3&&j==3&&k==3)cout<<"  "<<dp[j][k][l]<<endl;
                    dp[j][k+1][l]=max(dp[j][k][l],dp[j][k+1][l]);
                    if(dp[j][k][l]!=-1){
                        //cout<<i<<" "<<j<<" "<<k<<" "<<l<<" "<<dp[j][k][l]<<endl;
                        dp[j+1][k+1][((l+a[k])%i)]=max(dp[j][k][l]+a[k],dp[j+1][k+1][((l+a[k])%i)]);
                        //cout<<dp[j+1][k+1][((l+a[k])%i)]<<endl;
                        //cout<<((l-a[m]+i)%i+i)%i<<" "<<dp[j][k][l]<<" "<<dp[j+1][m+1][((l-a[m]+i)%i+i)%i]<<endl;
                    }
                    
                }
            }
        }
        rep(k,n){
                //cout<<i<<j<<k<<endl;
                rep(l,i){
                    
                    //if(i==3&&j==3&&k==3)cout<<"  "<<dp[j][k][l]<<endl;
                    dp[i][k+1][l]=max(dp[i][k][l],dp[i][k+1][l]);
                   
                }
            }
        //rep(j,n+1)cout<<j<<dp[i][j][x%i]<<endl;
        //rep(j,n+1){
        if(dp[i][n][x%i]==-1)continue;
            //cout<<i<<" "<<dp[i][j][0]<<endl;
        ans=min(ans,(x-dp[i][n][x%i])/i);
        //cout<<i<<"  "<<ans<<"  "<<dp[i][n][x%i] <<endl;
    }
    cout<<ans<<endl;
}
