#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
constexpr int inf=1e9+7;
constexpr ll longinf=1LL<<60 ;
constexpr ll mod=1e9+7 ;



int dp[111][111][111];

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin>>n;
    ll x;
    cin>>x;
    vector<int> a(n);
    rep(i,n)cin>>a[i];
    ll ans = x + 1;
    REP(t,1,n+1){
        rep(i,n+1)rep(j,n+1)rep(k,t){
            dp[i][j][k] = -inf;
        }
        dp[0][0][0]=0;
        rep(i,n)rep(j,i+1)rep(k,t){
            if(dp[i][j][k]<0)continue;
            dp[i+1][j+1][(k+a[i])%t]=max(dp[i+1][j+1][(k+a[i])%t],dp[i][j][k]+a[i]);
            dp[i+1][j][k]=max(dp[i+1][j][k],dp[i][j][k]);
        }
        if(dp[n][t][x%t]<0)continue;
        ans = min((x-dp[n][t][x%t])/t,ans);
    }
    cout<<ans<<endl;
    return 0;
}
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pll pair<ll, ll>
#define pb push_back
#define pii pair<ll ,pll>
#define task "parentheses"

using namespace std;
const int N = 105;
const ll mod = 1e18+7;
const int base = 350;
ll n, t, m, k, tong, a[N], dp[N][N], ans;
vector<ll> kq;
vector<ll> adj[N];

void sol()
{
    cin >> n >> m;
    for(int i = 1; i <= n; i ++)cin >> a[i];
    ans = mod;
    for(int i = 1; i <= n; i ++)
    {
        for(int l = 0; l <= i; l ++)
        {
            for(int r = 0; r <= i; r ++)dp[l][r] = -1;
        }
        dp[0][0] = 0;
        for(int j = 1; j <= n; j ++)
        {
            for(int l = j-1; l >= 0; l --)
            {
                for(int r = i-1; r >= 0; r --)
                {
                    if(dp[l][r] == -1)continue;
                    k = (r + a[j] % i) % i;
                    dp[l+1][k] = max(dp[l+1][k], dp[l][r] + a[j]);
                }
            }
        }
        if(dp[i][m%i] != -1)ans = min(ans, (m - dp[i][m%i]) / i);
    }
    cout << ans;
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    if(fopen(task".inp", "r"))
    {
        freopen(task".inp", "r", stdin);
        freopen(task".out", "w", stdout);
    }
    int ntest = 1;
    //cin >> ntest;
    while(ntest -- > 0)
    sol();
}
//https://docs.google.com/document/d/1JARtZUcSiWp9F95IoR8hhMp65eDu3vrRqvK_iUOQiFI/edit#heading=h.j89qf85z2g73
