#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll n,x;
  cin >> n >> x;
  ll a[n];
  rep(i,n) R a[i];
  ll ans=MAXL;
  REP(m,1,n+1) { 
    ll dp[2][m][m+1];
    rep(i,2)rep(j,m)rep(k,m+1) dp[i][j][k]=-MAXL;
    dp[0][0][0]=0;
    ll t=0;
    rep(i,n) {
      rep(j,m)rep(k,m+1) dp[t^1][j][k]=max(dp[t^1][j][k],dp[t][j][k]);
      rep(j,m) {
        rep(k,m) {
          if(dp[t][j][k]<0) continue;
          dp[t^1][(j+a[i])%m][k+1]=max(dp[t^1][(j+a[i])%m][k+1],dp[t][j][k]+a[i]);
        }
      }
      rep(j,m)rep(k,m+1) dp[t][j][k]=-MAXL;
      t^=1;
    }
    rep(j,m) {
      if(dp[t][j][m]<0) continue;
      ll y=x-dp[t][j][m];
      if(y%m==0) ans=min(ans,y/m);
    }
  }
  pr(ans);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}

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

// I have no idea what I'm doing

#ifdef DEBUG
#define debug(...) __VA_ARGS__
#else
#define endl '\n'
#define debug(...)
#endif
#define debugf(...) debug(printf(__VA_ARGS__))

const int N = 128;
using ll = long long;
const ll oo = 0x3f3f3f3f3f3f3f3fll;

ll dp[N][N];
int a[N];

int (((((((main)))))))() {
    cin.tie(0)->sync_with_stdio(false);

    int n; cin >> n;
    ll X; cin >> X;

    for (int i = 0; i < n; i++)
        cin >> a[i];

    ll ans = oo;
    for (int k = 1; k <= n; k++) { // we'll pick exactly k elements from A
        // Clear dp[][]
        // std::fill() doesn't work for some reason
        for (int i = 0; i < N; i++)
            for (int j = 0; j < N; j++)
                dp[i][j] = -oo;

        // Run a knapsack
        dp[0][0] = 0;
        for (int i = 0; i < n; i++) { // put the i-th element of A in the knapsack
            ll x = a[i];
            for (int j = k; j > 0; j--) { // the current subset has j elements
                for (int m = 0; m < k; m++) { // and the "previous" subset has sum = m (mod k)
                    ll sum = dp[j-1][m];
                    ll m2 = (x + sum) % k;
                    if (sum >= 0)
                        dp[j][m2] = max(dp[j][m2], x + sum);
                }
            }
        }

        // Get the best answer for a subset of A with size k
        ll cur = dp[k][X % k];
        debugf("k = %d, cur = %lld\n", k, cur);
        if (cur >= 0) {
            ans = min(ans, (X - cur) / k);
        }
    }

    cout << ans << endl;

    return 0;
}