#include<bits/stdc++.h>
#define pii pair<int,int>
#define eps 1e-7
#define equals(a,b) (fabs(a - b) < eps)
#define fi first
#define se second
using namespace std;
typedef long long ll;

const int maxn = 1e6 + 5;
const ll MOD = 1e9 + 7;

ll rd(){
	ll x = 0;
	int f = 1;
	char ch = getchar();
	while(ch < '0' || ch > '9'){
		if(ch == '-')  f = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9'){
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	return x * f;
}



struct PSegmentTree{
	struct Node{
		int l,r,d;
		Node *ls,*rs;
	};
	int a[maxn];
	Node pool[maxn * 30],*rt[maxn];
	int top;
	Node* build(int l,int r){
		Node *p = pool + (++top);
		p -> l = l,p -> r = r;
		if(l == r) {
			p -> d = a[l];
			return p;
		}
		int mid = l + r >> 1;
		p -> ls = build(l,mid);
		p -> rs = build(mid + 1,r);
		return p;
	}
	Node* copyNode(Node* rt){
		Node* p = pool + (++top);
		pool[top] = *rt;
		return p;
	}
	Node* change(Node* rt,int id,int x){
		Node* p = copyNode(rt);
		if(p -> l == p -> r) {
			p -> d = x;
			return p;
		}
		int mid = p -> l + p -> r >> 1;
		if(id <= mid) p -> ls = change(p -> ls,id,x);
		else p -> rs = change(p -> rs,id,x);
		return p;
	}
	int query(Node* rt,int id){
		if(rt -> l == rt -> r) {
			return rt -> d;
		}
		int mid = rt -> l + rt -> r >> 1;
		if(id <= mid) return query(rt -> ls,id);
		else return query(rt -> rs,id); 
	}
};


int main(){
	int n = rd();
	vector<int> v(n + 1);
	ll x = rd();	
	for(int i = 1;i <= n;i++)
		v[i] = rd();
	ll res = 1e18;
	for(int c = 1;c <= n;c++){
		int m = x % c;
		vector<vector<int>> dp(c + 1,vector<int>(c + 1,-1));
		dp[0][0] = 0;
		for(int k = 1;k <= n;k++)
			for(int i = min(k ,c) - 1;i >= 0;i--)
				for(int j = 0;j < c;j++)	
					if(~dp[i][j]) 
						dp[i + 1][(j + v[k] % c) % c] = max(dp[i + 1][(j + v[k] % c)% c],dp[i][j] + v[k]);
		if(~dp[c][m])
		 	res = min(res,(ll)(x - (ll)dp[c][m]) / c);		
	}
	cout << res;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
  int N;
  int64_t X;
  cin >> N >> X;
  vector<int64_t> w(N);
  for (int i = 0; i < N; ++i) cin >> w[i];

  // O(N^4)

  int64_t min_time = numeric_limits<int64_t>::max();
  // Brute force value for k.
  for (int k = 1; k <= N; ++k) {
    // dpv[i][j][m] = max value we can get when selecting j items from prefix [:i]
    // that sum up to value m, modulo k. (i is 1-based)
    vector<vector<vector<int64_t>>> dpv(N + 1, vector<vector<int64_t>>(k + 1, vector<int64_t>(k, -1e10)));
    dpv[0][0][0] = 0;  // Boundary condition.
    for (int i = 1; i <= N; ++i) {
      for (int j = 0; j <= k; ++j) {
        for (int m = 0; m < k; ++m) {
          if (j > 0) {
            // We take it.
            // new_mod = (old_mod + values[i - 1] % k) % k
            const int old_mod = (m - (w[i - 1] % k) + k) % k;
            dpv[i][j][m] = max(dpv[i][j][m], w[i - 1] + dpv[i - 1][j - 1][old_mod]);
          }

          // We don't take it.
          dpv[i][j][m] = max(dpv[i][j][m], dpv[i - 1][j][m]);
        }
      }
    }
    const int64_t max_val = dpv[N][k][X % k];

    if (max_val >= 0) {
      // Because of bounds (X > 10^9) max_val cannot be greater than X.
      assert(X >= max_val);
      min_time = min(min_time, (X - max_val) / k);
    }
  }
  cout << min_time << endl;
}