#include <bits/stdc++.h>
//#include <atcoder/all>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1e18;
//const ll mod = 1000000007;
ll dp[105][105][105];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, X;
    cin >> N >> X;
    for(int i = 0; i <= N; i++) {
        for(int j = 0; j <= N; j++) {
            for(int k = 0; k <= N; k++) {
                dp[i][j][k] = -INF;
            }
        }
    }
    for(int i = 0; i <= N; i++) {
        dp[0][i][0] = 0;
    }
    for(int t = 0; t < N; t++) {
        ll A;
        cin >> A;
        for(int i = t; i >= 0; i--) {
            for(int j = 1; j <= N; j++) {
                for(int k = 0; k < j; k++) {
                    if(dp[i][j][k] < 0) continue;
                    chmax(dp[i+1][j][(k+A)%j], dp[i][j][k] + A);
                }
            }
        }
    }
    ll ans = INF;
    for(int i = 1; i <= N; i++) {
        for(int j = 0; j < i; j++) {
            if(dp[i][i][j] < 0) continue;
            if(dp[i][i][j] > X) continue;
            ll delta = X - dp[i][i][j];
            if(delta % i != 0) continue;
            chmin(ans, delta / i);
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return 1;
    }
    return 0;
}
#define DEBUG
#ifdef DEBUG
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << '(' << p.first << ',' << p.second << ')';
    return os;
}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
    os << '{';
    for(int i = 0; i < (int)v.size(); i++) {
        if(i) { os << ','; }
        os << v[i];
    }
    os << '}';
    return os;
}
void debugg() { cerr << endl; }
template <class T, class... Args>
void debugg(const T &x, const Args &... args) {
    cerr << " " << x;
    debugg(args...);
}
#define debug(...)                                                             \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]: ", debugg(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

struct Setup {
    Setup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __Setup;

using ll = long long;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define FOR(i, a, b) for(int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

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

int main() {
    cin >> N >> X;
    REP(i, N) cin >> a[i];

    ll ans = LLINF;

    FOR(k, 1, N+1) {
        REP(i,N+1)REP(j,k+1)REP(l,k) dp[i][j][l] = -LLINF;
        dp[0][0][0] = 0;
        
        REP(i, N) {
            REP(cnt, k + 1) {
                REP(r, k) {
                    if(dp[i][cnt][r] == -LLINF) continue;

                    // えらぶ
                    if(cnt < k) {
                        ll cost = 0;
                        if(a[i] + r >= k) {
                            cost++;
                            ll remain = a[i] - (k - r);
                            cost += remain / k; 
                        }
                        int nxt_r = (a[i] + r) % k;
                        if((dp[i][cnt][r] + cost) * k + nxt_r <= X) {
                            chmax(dp[i+1][cnt+1][nxt_r], dp[i][cnt][r] + cost);
                        }
                    }
                    

                    // えらばない
                    chmax(dp[i+1][cnt][r], dp[i][cnt][r]);
                }
            }
        }

        if(dp[N][k][X%k] == -LLINF) continue;

        chmin(ans, (X - X % k - dp[N][k][X%k] * k) / k);

    }

    assert(ans != LLINF);
    cout << ans << endl;
}