#include <bits/stdc++.h>
using namespace std;
using namespace chrono;


#define fastio                  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define input_output            freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); freopen("error.txt", "w", stderr);


template <typename Arg1>
void prn(Arg1&& arg1) { cout<<arg1<<"\n";}
template <typename Arg1, typename... Args>
void prn(Arg1&& arg1, Args&&... args) { cout<<arg1<<" "; prn(args...); }

template <typename Arg1>
void prs(Arg1&& arg1) { cout<<arg1<<" ";}
template <typename Arg1, typename... Args>
void prs(Arg1&& arg1, Args&&... args) { cout<<arg1<<" "; prs(args...); }

template <typename Arg1>
void read(Arg1&& arg1) { cin>>arg1; }
template <typename Arg1, typename... Args>
void read(Arg1&& arg1, Args&&... args) { cin>>arg1; read(args...); }

#define int                     long long
#define all(ds)                 ds.begin(), ds.end()
#define uniq(v)                 (v).erase(unique(all(v)),(v).end())
#define gcd(x,y)                __gcd(x,y)
#define mp                      make_pair
#define rep(i,a,b)              for(int i=a;i<b;i++)
#define precise(x)              cout<<fixed<<setprecision(x)
#define endl                    "\n"



/* debug */
#ifndef ONLINE_JUDGE
#define debug(x) cerr << #x<<" "; _print(x); cerr << endl;
#else
#define debug(x);
#endif

void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(double t) {cerr << t;}
 
template <class T, class V> void _print(pair <T, V> p);
template <class T> void _print(vector <T> v);
template <class T> void _print(set <T> v);
template <class T, class V> void _print(map <T, V> v);
template <class T> void _print(multiset <T> v);
template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.first); cerr << ","; _print(p.second); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
/* debug */


const long long INF = 2e18;
const int32_t MOD = 1e9+7;
const int N = 2e5+5;

int n, m, k, q, r, l, x, y, z;
int a[N], b[N], c[N];
string s, t;
int ans = 0;


void solve(){
    int t = 1; 
    // read(t);
    while(t--){
        read(n,x);
        // sum is congruent to x modulo n
        int a[n];
        rep(i,0,n) read(a[i]);

        int ans = x;
        for(int size = 1; size <= n; ++size){
            vector<vector<int>>dp(size+1, vector<int>(size, -1));
            dp[0][0] = 0;

            for(int val: a){
                for(int i = size-1; i >= 0; --i){
                    for(int j = 0; j < size; ++j){
                        if(dp[i][j] == -1) continue;
                        int next = dp[i][j] + val;
                        dp[i+1][next%size] = max(dp[i+1][next%size], next); 
                    }
                }
            }

            int start = dp[size][x%size];
            if(start == -1) continue;
            ans = min(ans, (x-start)/size);
        }
        prn(ans);
    }
}

signed main()
{
#ifndef ONLINE_JUDGE  
    input_output  
#else   
    fastio
#endif

#ifdef SIEVE
    sieve();
#endif

#ifdef NCR
    init();
#endif

    auto start1 = high_resolution_clock::now();
    solve();
    auto stop1 = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop1 - start1);

#ifndef ONLINE_JUDGE
    cerr << "Time: " << duration.count() / 1000 << endl;
#endif

    return 0;
}
#include <bits/stdc++.h>

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> VI;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;
typedef tuple<ll, ll, ll, ll> t4;

#define rep(a,n) for(ll a = 0;a < n;a++)
#define repi(a,b,n) for(ll a = b;a < n;a++)

#include <bits/stdc++.h>
using namespace std;

template<typename T>
void chmax(T& reference, T value) {
	reference = max(reference, value);
}

template<typename T>
void chmaxmap(map<T, T>& m, T key, T value) {
	if (m.count(key)) {
		chmax(m[key], value);
	}
	else {
		m[key] = value;
	}
}

template<typename T>
void chmin(T& reference, T value) {
	reference = min(reference, value);
}

ll solve(ll c) {
	vector<ll> as;
	while (c) {
		as.push_back(c % 10);
		c /= 10;
	}
	sort(as.begin(), as.end());
	int n = as.size();
	ll g = 0, l = 0;
	for (int i = 0; i < n; i++) {
		g *= 10;
		g += as[n - 1 - i];
		l *= 10;
		l += as[i];
	}
	return g - l;

}

int main() {
	ll n, x;
	cin >> n >> x;
	vector<ll> as(n);
	ll u = 0;
	rep(i, n) {
		cin >> as[i];
		chmax(u, as[i]);
	}	
	ll ans = x - u;
	for (int i = 2; i <= n; i++) {
		vector<vector<vector<ll>>> dp(n+1, 
			vector<vector<ll>>(n + 1,
			vector<ll>(n + 1, -1)));
		dp[0][0][0] = 0;
		//j番目
		for (int j = 0; j < n; j++) {
			//k個取った
			for (int k = 0; k <= j; k++) {
				//余りがm
				for (ll m = 0; m < i; m++) {
					if (dp[j][k][m] >= 0) {
						chmax(dp[j+1][k][m], dp[j][k][m]);
						ll nm = (m + as[j]) % i;
						chmax(dp[j + 1][k + 1][nm], dp[j][k][m] + as[j]);
					}
				}
			}
		}
		for (int m = 0; m < i; m++) {
			ll v = dp[n][i][m];
			if (v >= 0) {
				if ((x - v) % i == 0) {
					chmin(ans, (x - v) / i);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

