#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <deque>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <map>
#include <stack>
#include <set>
using namespace std;

#define lson 2*i  
#define rson 2*i+1  
#define LS l,mid,lson  
#define RS mid+1,r,rson  
#define UP(i,x,y) for(i=x;i<=y;i++)  
#define DOWN(i,x,y) for(i=x;i>=y;i--)  
#define MEM(a,x) memset(a,x,sizeof(a))  
#define W(a) while(a)  
#define gcd(a,b) __gcd(a,b)  
#define ll long long  
#define MAX 1000005  
#define MOD 1000000007  
#define EXP 1e-8  
#define lowbit(x) (x&-x)  
const ll INF = 0x1fffffffffffffff;
ll gcd(ll p,ll q){return q==0?p:gcd(q,p%q);}
ll qpow(ll p,ll q){ll f=1;while(q){if(q&1)f=f*p;p=p*p;q>>=1;}return f;}
void chmin(ll& a, ll b){ if(a > b) a = b; }
void chmax(ll& a, ll b){ if(a < b) a = b; }



ll dp[105][105];
int main () {
    int n; ll x, a[105] = {0}, ans = INF;
    cin >> n >> x;
    for (int i = 0; i < n; i++) cin >>a[i];

    for (int num = 1; num <= n; ++num) {
        // select num obj
        for (int j = 0; j < 105; ++j) for (int  k = 0; k < 105; ++k) dp[j][k] = -INF;
        dp[0][0] = 0;
        for (int i = 0; i < n; ++i) {
            for (int j = num-1; j >= 0; --j) {
                for (int k = 0; k < num; ++k) {
                    if (dp[j][k] != -INF) { 
                        chmax(dp[j+1][(k + a[i]) % num], a[i] + dp[j][k]); 
                    }
                }
            }
        }
        if (dp[num][x % num] != -INF) 
            chmin(ans, (x - dp[num][x % num]) / num);
    }
    cout << ans <<endl;
    return 0;
}
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
using namespace std;

//#include <atcoder/all>
// using namespace atcoder;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define rrepLRE(i, l, r) for (ll i = (l); i >= (r); --i)
#define Sort(v) sort(v.begin(), v.end())
#define rSort(v) sort(v.rbegin(), v.rend())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, y) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), y))
#define Upper_bound(v, y) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), y))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

ll dx[9] = {-1, 1, 0, 0, -1, -1, 1, 1, 0};
ll dy[9] = {0, 0, -1, 1, -1, 1, -1, 1, 0};

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;
}

/* Macros reg. ends here */

const ll INF = 1LL << 50;

int main() {
  // ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  ll n, x;
  cin >> n >> x;

  vvvll dp(n + 1, vvll(n + 1, vll(n + 1, -1)));
  repLRE(i, 1, n) dp[0][i][0] = 0;
  rep(_, n) {
    ll a;
    cin >> a;
    vvvll ndp = dp;
    rep(i, n) repLRE(j, 1, n) rep(k, j) {
      if (dp[i][j][k] != -1) {
        ll ni = i + 1;
        ll nk = (dp[i][j][k] + a) % j;
        chmax(ndp[ni][j][nk], dp[i][j][k] + a);
      }
    }
    swap(ndp, dp);
  }

  ll ans = x;
  repLRE(i, 1, n) rep(k, i) {
    ll v = x - dp[i][i][k];
    if (dp[i][i][k] != -1 && v % i == 0) {
      ll tmp = v/i;
      chmin(ans, tmp);
    }
  }

  cout << ans << endl;

  return 0;
}
