// 2021-02-20 21:59:14
// clang-format off
#include <bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;

// clang-format on
const ll inf = 1e18;
int n;
ll x, ans;
vector<ll> a;
ll solve(ll k) {
  vector<vector<ll> > dp(n + 1, vector<ll>(k, -1));
  dp[0][0] = 0;
  rep(i, n) {
    vector<vector<ll> > p = dp;
    repc(j, i) {
      rep(ki, k) {
        if (p[j][ki] >= 0) {
          int nk = (ki + a[i] % k) % k;
          chmax(dp[j + 1][nk], p[j][ki] + a[i]);
        }
      }
    }
  }
  ll res = inf;
  if (dp[k][x % k] > 0) {
    res = ((x - dp[k][x % k]) / k);
  }
  return res;
}
void answer() {
  cin >> n >> x;
  a.resize(n);
  {
    ll mx = 0;
    rep(i, n) {
      cin >> a[i];
      chmax(mx, a[i]);
    }
    ans = x - mx;
  }
  REPC(k, 2, n) chmin(ans, solve(k));
  cout << ans << '\n';
}

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int long long int
#define endl "\n"
#define MOD 1000000007
#define mod 1000000007
#define M 1000000007
#define pb push_back
#define take(a,b,c) for(int b=0;b<c;b++) cin>>a[b]
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mx 1000005
#define fiint(a,b) memset(a,b,sizeof(a))
#define bitcount __builtin_popcount
#define fori(i,a,b) for(int i=a;i<b;i++)
#define ford(i,a,b) for(int i=a;i>=b;i--)
#define debug(x) cout<<x<<endl;
#define cases(t) int t; cin>>t; while(t--)
#define inf1 INT_MAX
#define all(a) a.begin(),a.end()
#define vec vector<int>
#define pii pair<int,int>
#define plii pair<int,int>
#define pint pair<int,int>
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define mp make_pair
 
#define sz(x) (int)x.size()
#define PI    3.14159265359
 
 
 
int factorial[10000001]={0};
 
int gcd(int a, int b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}


int powerFunction(int x,int y){
    int res = 1;
     int p = mod;
    x = x;
    while (y > 0){
        if (y & 1)
            res = (res*x)%p ;
        y = y>>1;
        x = (x*x)%p ;
    }
    return res;
}

void factorialFunction(int maxLimit){
    factorial[0]=1;
    for(int i=1 ; i <= maxLimit ; i++)
    factorial[i]=(factorial[i-1]*i)%MOD;
    return;
}
 
int nCr(int n, int r)
{
    if(r < 0 || r > n){
        return 0;
    }
    int temp = factorial[n];
    temp *= (powerFunction(factorial[r], MOD-2)%MOD);
    temp %= MOD;
    temp *= (powerFunction(factorial[n-r], MOD-2)%MOD);
    temp %= MOD;
    return temp;
}

vec v(200);
int n,x;
int le ;
int dp[105][105][105];
int find(int i , int j , int k  )
{
   
    if(i == 0)
    {
        if(v[i] % le == k && j == 0 )
            return v[i];
        else if(k == 0 && j == -1  ) return (int)0;
        else return INT_MIN;
    }
    if(j == -1 )
    {
        if(k == 0 ) return 0;
        else return INT_MIN;
    }
   if(dp[i][j][k] != INT_MAX)
        return dp[i][j][k];
    int a = find(i - 1 , j , k);
    int re = v[i] % le;
    if(re <= k )
        re = k - re;
    else { re = le - re +  k  ;  }
    int b = INT_MIN;
    if(j >= 0)
    b = v[i] + find(i - 1 , j - 1 , re  );
    dp[i][j][k] = max(a , b);
  //  cout<<i<<" " << j <<" "<<k <<" "<< le + 1 <<" " << a <<" " << b <<endl;
    return max( a , b );
}


signed main()
{
    cin>>n>>x;
    for(int i  = 0 ; i < n ;i++) cin>>v[i];
    int ans  = x;
    
    for(int i = 0 ; i < n ;i++)
    {
        le = (i+1);
        for(int i = 0 ; i  < 105 ;i++)
        for(int  j = 0 ; j < 105 ;j++)
        for(int  k =  0 ; k  < 105 ;k++ )
        dp[i][j][k] =INT_MAX;
      
        int a =  find(n-1 , i ,  x % (i+1)  );
        if(a <= 0 ) continue;
     //   cout<<a<<endl;
       ans = min(ans , (x - a) / (i+1) );
    }
    cout<<ans<<endl;
}
    


