#include <bits/stdc++.h>
#define REP(i, nn ) for(int i = 0 ; i < (int) nn; i++)
#define REPS(i, ss, nn ) for(int i = ss ; i < (int) nn; i++)
#define REV(i, ss, nn ) for(int i = ss ; i >= nn; i--)
#define deb(x) std::cout << #x << " " << x << endl;
#define debl(x) std::cout << #x << " " << x << " ";
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
namespace std{
    template<class Fun>
    class y_combinator_result{
        Fun fun_;
        public:
            template<class T>
            explicit y_combinator_result(T &&fun) : fun_(std::forward<T>(fun)){}
            template<class ...Args>
            decltype(auto) operator()(Args&&...args){
                return fun_(std::ref(*this), std::forward<Args>(args)...);
            }
    };
    template<class Fun>
    decltype(auto) y_combinator(Fun && fun){
        return y_combinator_result<std::decay_t<Fun>>(std::forward<Fun>(fun));
    }
};
template<typename T>
bool umax(T& a, T b){
    bool ret = a < b;
    if(ret) a = b;
    return ret;
}
template<typename T>
bool umin(T& a, T b){
    bool ret = a > b;
    if(ret) a = b;
    return ret;
}
struct edge{
    int to; ll cost;
    int from;
    edge(){ edge(0,0);}
    edge(int to_, ll cost_) : to(to_), cost(cost_){}
    edge(int to_, int from_, ll cost_) : to(to_), cost(cost_), from(from_){}
};

template<typename... T>
void read(T& ... a){
    ((cin >> a),...);
}

template<typename... T>
void write(T... a){
    ((cout << a),...);
}


template<typename T>
vector<T> read_array(int sz){
    vector<T> ret(sz);
    for(auto & x : ret) cin >> x;
    return ret;
}

constexpr int mxN = 101;
ll a[mxN];
int n;
ll best[mxN];
ll x, y;
ll dp[mxN][mxN][mxN];

void solve(){
    read(n);
    read(x);
    REP(i, n){
        read(a[i]);
    }
    ll ans = x - a[0];

    REPS(sz, 1, n + 1){
        y = x % sz;
        //initialization
        REP(i, n){
            int need = min(i + 1, sz);
            REPS(j,1 ,need + 1){
                REP(k, sz){
                    dp[i][j][k] = 0;
                }
            }
        }

        // deb(sz)
        dp[0][1][a[0] % sz] = a[0];
        
        REPS(i, 1, n){
            int need = min(i + 1, sz);
            REPS(j,1 ,need + 1){
                REP(k, sz){
                    umax(dp[i][j][k], dp[i-1][j][k]);
                    if( j == 1){
                        if(a[i] % sz == k ) umax(dp[i][j][k], a[i]);
                        continue;
                    }
                    int k2 = (sz + k - a[i] % sz) % sz;
                    if(dp[i-1][j-1][k2] > 0)
                        umax(dp[i][j][k], dp[i-1][j-1][k2] + a[i]);

                    // debl(i) debl(j) debl(k)
                    // deb(dp[i][j][k])
                }
            }
        }

        REP(i, n){
            if(dp[i][sz][y] > 0)
                umin(ans, (x - dp[i][sz][y]) / sz );
        }

    }
    cout << ans << endl;
}

int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/
    int T = 1;
    // cin >> T;
    while(T--)
        solve();
    return 0;
}


#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>
#include <cstddef>
#include <type_traits>
#include <vector>
 
using namespace std;
using lint = long long int;
long long int INF = 1e18;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;
 
template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}
 
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i, n) for(int i=0;i<(int)(n);i++)


int main() {
  
  lint n, x; cin >> n >> x;
  vector<lint> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }


  lint ans = INF;
  for (lint k = 1; k <= n; k++) {
    vector<vector<lint>> dp(k + 1, vector<lint>(k, -INF));

    dp[0][x % k] = 0;
    for (int i = 0; i < n; i++) {
      vector<vector<lint>> nxt(k + 1, vector<lint>(k, -INF));

      for (int j = 0; j <= k; j++) {
        for (int l = 0; l < k; l++) {
          if (dp[j][l] == -INF) continue;
          // 使わない
          chmax(nxt[j][l], dp[j][l]);
          // 使う
          if (j + 1 <= k) {
            chmax(nxt[j + 1][(l + 10000000 * k - a[i]) % k], dp[j][l] + a[i]);
          }
        }
      }
      swap(dp, nxt);
    }
    
    // cerr << "k = " << k << ", dp = " << dp[k][0] << endl;
    if (dp[k][0] == -INF) continue;
    else {
      // assert((x - dp[k][0]) % k == 0);
      chmin(ans, (x - dp[k][0]) / k);
    }
  }

  cout << ans << endl;
  return 0;
}
