#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, ll>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << '\n'; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

const int sz = 105;
ll dp[sz][sz][sz];

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n, x;
    cin, n, x;
    vector<ll> a(n);
    rep(i, 0, n) {
        cin, a[i];
    }
    const ll inf = 1LL << 60;
    ll ans = inf;
    rep(k, 1, n + 1) {
        rep(t, 0, sz) rep(b, 0, sz) rep(c, 0, sz) dp[t][b][c] = -1;
        dp[0][0][0] = 0;
        rep(i, 0, n) {
            rep(j, 0, k + 1) {  // cnt
                rep(t, 0, k) {  // mod
                    if (dp[i][j][t] == -1) continue;
                    ll num = dp[i][j][t] * k + t;
                    ll aft = num + a[i];
                    ll div = aft / k;
                    ll q = aft % k;
                    chmax(dp[i + 1][j][t], dp[i][j][t]);
                    if (j + 1 <= k) {
                        chmax(dp[i + 1][j + 1][q], div);
                    }
                }
            }
        }
        ll aft = dp[n][k][x % k];
        if (aft == -1) {
            continue;
        }
        chmin(ans, (x - aft * k - x % k) / k);
    }
    print(ans);
    return 0;
}

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

long long dp[110][110][110][110] = {0}; //何個目まで見たか　何個選んだか mod mod何か

int main(){
    long long N,X;
    cin >> N >> X;
    vector <long long> potion;
    long long maxa = 0;
    for(int i=0;i<N;i++){
        long long a;
        cin >> a;
        potion.push_back(a);
        maxa = max(a,maxa);
    }
    if(N==1){
        cout << X-potion[0] << endl;
        return 0;
    }
    for(int i=0;i<N;i++){
        for(int j=0;j<=i;j++){
            for(int k=2;k<=N;k++){
                for(int l=0;l<k;l++){
                    if(dp[i][j][k][l]==0&&(l!=0||j!=0)){
                        continue;
                    }
                    dp[i+1][j+1][k][(l+potion[i])%k]=max(dp[i+1][j+1][k][(l+potion[i])%k],dp[i][j][k][l]+potion[i]);
                    dp[i+1][j][k][l]=max(dp[i+1][j][k][l],dp[i][j][k][l]);
                }
            }
        }
    }
    /*
    for(int i=1;i<=N;i++){
        for(int j=1;j<=i;j++){
            for(int k=2;k<=N;k++){
                for(int l=0;l<k;l++){
                    cout << i<< "番目までで" << j << "個選んで mod "<< k << " = " << l << "の最大値は " <<dp[i][j][k][l] << endl;
                }
                cout << endl;
            }
            cout << endl;
        }
        cout << endl;
    }
    */
    long long ans = 9000000000000000000;
    
    for(long long j=N;j>0;j--){
        for(int i=N;i>=j;i--){
            if(dp[i][j][j][X%j]!=0){
                ans = min(ans,(X-dp[i][j][j][X%j])/j);
            }
        }
    }
    if(ans == 9000000000000000000){
        ans = X - maxa;
    }
    cout << ans << endl;
    
}