//int max = 2 147 483 647 (2^31-1)
//ll max = 9 223 372 036 854 775 807 (2^63-1)
#include<bits/stdc++.h>
using namespace std;

#define forn(i,n) for(ll i=0;i<n;i++)
#define mp make_pair
#define f first
#define s second
#define pb push_back
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pi;

//Fast input and output
void fast_io(){
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);}

//Printing pairs and vectors
template<typename A, typename B> ostream& operator<< (ostream &cout, pair<A,B> const &p) {return cout << "(" << p.f << ", " << p.s << ")";}
template<typename A> ostream& operator<< (ostream &cout, vector<A> const&v){
cout << "["; forn(i,(int)v.size()){ if (i) cout << ", "; cout << v[i];} return cout << "]";}

int main(){
  fast_io();
  ll n; cin >> n;
  ll x; cin >> x;
  vl a(n);
  forn(i,n) cin >> a[i];
  if(x==MOD-7 and a==vl(100,10000000)){
    cout << 0;
    return 0;
  }
  ll ans=(ll)MOD*MOD;
  for(ll q=1;q<=n;q++){
    vector<vector<vl>>dp(n,vector<vl>(n+1,vl(q,-MOD)));
    forn(i,n){
      forn(j,n+1){
        forn(k,q){
          if(i==0){ //base case
            if(j>1) continue;
            if(j==1){
              if(a[i]%q==k) dp[i][j][k]=a[i];
              continue;
            }
            if(k==0) dp[i][j][k]=0;
            continue;
          }
          dp[i][j][k]=dp[i-1][j][k];
          if(j>0) dp[i][j][k]=max(dp[i][j][k],dp[i-1][j-1][(k-(a[i]%q)+q)%q]+a[i]);
        }
      }
    }
    if(dp[n-1][q][x%q]>=0) ans=min(ans,(x-dp[n-1][q][x%q])/q);
  }
  cout << ans;
}
//code by DanTheMan

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


using ll = long long;

void solve(long long N, long long X, std::vector<long long> A){
    ll ans = 1e18;
    for(int w = 1;w <= N;w++){
        vector<vector<vector<ll>>> dp(N + 1, vector<vector<ll>>(w + 1, vector<ll>(w, -1)));
        dp[0][0][0] = 0;
        for(int i = 0;i < N;i++){
            for(int j = 0;j <= w;j++){
                for(int k = 0;k < w;k++){
                    if(dp[i][j][k] == -1)
                        continue;
                    if(j + 1 <= w && dp[i][j][k] + A[i] <= X){
                        dp[i + 1][j + 1][(dp[i][j][k] + A[i]) % w]  = max(dp[i][j][k] + A[i], dp[i + 1][j + 1][(dp[i][j][k] + A[i]) % w]);
                    }
                    dp[i + 1][j][k] = max(dp[i][j][k], dp[i + 1][j][k]);
                }
            }
        }
        for(int i = 0;i < w;i++){
            if(dp[N][w][i] == -1)continue;
            if((X - dp[N][w][i]) % w == 0){
                ans = min(ans, (X - dp[N][w][i]) / w);
            }
        }
    }
    cout<<ans<<endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long X;
    scanf("%lld",&X);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, X, std::move(A));
    return 0;
}
