#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
// please, read the question correctly (do you need set or multiset)???
const int N=200010; //check the limits, dummy
int a[N];
int n, m, md;
int mem[101][101][101];
int dp(int x, int rm, int nm){
	if(nm==m){
		if(rm == md){
			return 0;
		}
		else{
			return -2e9;
		}
	}
	if(x>=n){
		return -2e9;
	}
	if(mem[x][rm][nm]!=-1){
		return mem[x][rm][nm];
	}
	ll res;
	res = max(dp(x+1, rm, nm), a[x]+dp(x+1, (rm+a[x])%m, nm+1));
	mem[x][rm][nm]=res;
	return res;
}
int main(){
	ll x;
	scanf("%d%lld",&n,&x);
	for(int i=0; i<n; ++i){
		scanf("%d",a+i);
	}
	ll ans = 10+1e18, tmp;
	for(ll i=1; i<=n; ++i){
		m = i;
		md = x%i;
		memset(mem, -1, sizeof mem);
		tmp = dp(0, 0, 0);
		if(tmp>=0){
			ans = min(ans, (x-tmp)/i);
		}
	}
	cout<<ans<<endl;
}
#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline")
#pragma GCC option("arch=native","tune=native","no-zero-upper")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define infL (1LL<<60)
#define inf (1<<30)
#define inf9 (1000000000)
#define MOD 1000000007//998244353//1000000007
#define EPS 1e-9
#define Gr 9.8
#define PI acos(-1)
#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REQ(i,n) for(int (i)=1;(i)<=(int)(n);(i)++)
#define lch (rt<<1)
#define rch (rt<<1|1)
#define readmp(n) for(int i=0,u,v;i<n;i++) {scanf("%d%d",&u,&v); mp[u].push_back(v); mp[v].push_back(u);}
typedef  long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef ll ValType;
template<typename  T> void maxtt(T& t1, T t2) {
    t1=max(t1,t2);
}
template<typename  T> void mintt(T& t1, T t2) {
    t1=min(t1,t2);
}
#define MAX (135)

bool debug = 0;
int n,m,k;
int dx[4] = {0,1,0,-1}, dy[4] = {1,0,-1,0};
string direc="RDLU";
const ll MOD2 = (ll)MOD * (ll)MOD;
ll ln, lk, lm;
void etp(bool f = 0) {
    puts(f ?"YES" : "NO");
    exit(0);
}
void addmod(int &x, int y, int mod = MOD){
    x+=y; if (x>=mod) x-=mod;
    if(x<0) x+=mod;
    assert(x>=0 && x<mod);
}
void et(int x=-1) {
    printf("%d\n", x); exit(0);
}
ll fastPow(ll x, ll y, int mod=MOD) {
    ll ans = 1;
    while(y>0) {
        if(y&1) ans = (x * ans)%mod;
        x = x*x%mod;
        y>>=1;
    }
    return ans;
}
ll gcd1(ll x, ll y) {
    return y?gcd1(y,x%y):x;
}



void fmain(int tid) {
    scanf("%d%lld", &n,&lk);
    vector<int> a(n+1, 0);
    REQ(i,n) scanf("%d", &a[i]);
    ll ans=infL;
    REQ(c, n) {
        vector<vector<vector<int>>> dp(n+1, vector<vector<int>>(c+1, vector<int>(c+1,-1)));
        dp[0][0][0]=0;
        REQ(i,n) {
            for(int j=0;j<=c;j++) REP(z,c) if (dp[i-1][j][z]!=-1) {
                maxtt(dp[i][j][z], dp[i-1][j][z]);
                if(j<c) maxtt(dp[i][j+1][(z+a[i])%c], dp[i-1][j][z] + a[i]);
            }
        }
        int z=lk%c;
        if (dp[n][c][z] != -1){
            ll tt= lk-dp[n][c][z];
            assert(tt%c==0);
            mintt(ans, tt/c);
        }
    }
    printf("%lld\n", ans);
}
int main() {
    int t=1;
//    init();
//    scanf("%d", &t);
    REQ(i,t) {
        fmain(i);
    }
    return 0;
}
