#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0,endrep=(n); i<endrep; ++i)
#define rep1(i,n) for(ll i=1,endrep=(n); i<=endrep; ++i)
#define revrep(i,n) for(ll i=(n)-1; i>=0; --i)
inline constexpr ll Inf = (1ULL << 60) -123456789;
#define fastio cin.tie(nullptr); ios_base::sync_with_stdio(false);
#define newl '\n'
#define YN(e) ((e)?"Yes":"No")
#define all(a) begin(a),end(a)
#define rall(a) rbegin(a),rend(a)
template <class T,class U> bool updmax(T& a, U b) { if(b>a){ a=b; return true;} return false;}
template <class T,class U> bool updmin(T& a, U b) { if(b<a){ a=b; return true;} return false;}
inline constexpr int Mod = 1000000007;
//inline constexpr int Mod = 998244353;
#define dbg(a) cout << #a << ": " << a << endl;
#define dbg1(a,n) cout<<#a<<": "; rep(i,n) cout<<a[i]<<" "; cout<<endl;
#define dbg2(m,h,w) cout<<#m<<":"<<endl; rep(i,h){ rep(j,w)cout<<m[i][j]<<" "; cout<<endl; }
int rng(int n) { return rand()/(RAND_MAX+1.0)*n; }

ll dp[105][105][105];
int main() {
    fastio;
    ll ans{Inf};
    ll N,X;
    cin >> N >> X;
    vector<ll> a(N);
    rep(i,N) cin >> a[i];
    rep1(k,N) {
        rep(i,N+1) rep(j,k+1) rep(l,k) dp[i][j][l] = -Inf;
        dp[0][0][0] = 0;
        rep(i,N) rep(j,k+1) rep(l,k) {
            updmax(dp[i+1][j][l], dp[i][j][l]);
            updmax(dp[i+1][j+1][(l+a[i])%k], dp[i][j][l] + a[i]);
        }
        ll m = dp[N][k][X%k];
        if (m < 0) continue;
        updmin(ans, (X-m)/k);
    }
    cout << ans << endl;
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 100 + 10;
long long n, x;
void mx(long long &a, long long b){
	if(b <= x) a = max(a, b);
}
long long a[maxn];
long long dp[2][maxn][maxn][maxn];
// mod tot res
int main(){
	memset(dp, -1, sizeof dp);
	cin >> n >> x;
	for(int i = 1; i <= n; i++) cin >> a[i];
	for(int mod = 1; mod <= n; mod++) dp[0][mod][0][0] = 0;
	for(int i = 0; i < n; i++){
		int now = i & 1;
		for(int mod = 1; mod <= n; mod++){
			for(int tot = 0; tot <= i; tot++){
				for(int res = 0; res < mod; res++){
					if(dp[now][mod][tot][res] == -1) continue;
					mx(dp[now ^ 1][mod][tot + 1][(res + a[i + 1]) % mod], dp[now][mod][tot][res] + a[i + 1]);
					mx(dp[now ^ 1][mod][tot][res], dp[now][mod][tot][res]);
				}
			}
		}
	}
//	for(int mod = 1; mod <= n; mod++)
//		for(int tot = 0; tot <= n; tot++){
//			for(int res = 0; res < mod; res++){
//				printf("dp[%d][%d][%d] = %lld\n", mod, tot, res, dp[n & 1][mod][tot][res]);
//			}
//		}
	int now = n & 1;
	long long ans = x;
	for(int tot = 1; tot <= n; tot++){
		if(dp[now][tot][tot][x % tot] > 0 && x >= dp[now][tot][tot][x % tot] ) ans = min(ans, (x - dp[now][tot][tot][x % tot]) / tot);	
//		printf("tot = %d x %% tot = %lld ans = %lld\n", tot, x % tot, ans);
	}
	cout << ans << endl;
	return 0;
}