#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

#if defined(DONLINE_JUDGE)
	#define NDEBUG
#elif defined(ONLINE_JUDGE)
	#define NDEBUG
#endif

template<typename T> std::vector<T> make_v(size_t a){return std::vector<T>(a);}
template<typename T, typename... Ts> auto make_v(size_t a, Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}

int main() {
	int n; i64 x; scanf("%d%lld", &n, &x);
	std::vector<int> a(n); for(auto& v: a) scanf("%d", &v);

	i64 ans = 1LL << 60;
	for(int k = 1; k <= n; k++) {
		auto dp = make_v<int>(k + 1, k + 1); // dp[i][j] := sum (i 個使って sum % k = j)
		for(int i = 0; i < dp.size(); i++) for(int j = 0; j < dp[i].size(); j++) dp[i][j] = -1;
		dp[0][0] = 0;

		for(auto v: a) {
			for(int i = k - 1; i >= 0; i--) {
				for(int j = 0; j < k; j++) {
					if(dp[i][j] == -1) continue;
					int sum = dp[i][j] + v;
					int to = sum % k;
					if(dp[i + 1][to] == -1) dp[i + 1][to] = sum;
					dp[i + 1][to] = std::max(dp[i + 1][to], sum);
				}
			}
		}

		int r = x % k;
		if(dp[k][r] == -1) continue;
		ans = std::min(ans, (x - dp[k][r]) / k);

		#ifndef NDEBUG
		cout << k << ": " << dp[k][r] << endl;
		#endif
	}

	printf("%lld\n", ans);
	return 0;
}

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

#define fr(i,n) for(int i = 0; i<n; i++)
#define sz(v) (int)(v.size())
#define prin(a) cout << #a << " = " << a << endl
#define all(v) (v).begin(),(v).end()
#define rmax(a,b) a = max<ll>(a,b)
#define rmin(a,b) a = min<ll>(a,b)

typedef long long ll;

const int N = 110;
ll dp[N][N][N];

ll v[N];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n, targ; cin >> n >> targ;
	ll soma = 0;
	fr(i,n) cin >> v[i], soma+=v[i];
	if(soma==targ){
		cout << 0 << "\n";
		return 0;
	}
	
	ll ans = LLONG_MAX;
	
	for(ll t = 1; t<=n; t++){
		fr(i,n+1) fr(j,n+1) fr(k,n+1) dp[k][i][j] = INT_MIN;
		dp[0][0][0] = 0;
		
		fr(i,n){
			fr(t_sofar,n+1) fr(p,n){
				ll r = (p+v[i])%t;
				rmax(dp[i+1][t_sofar][p],
					dp[i][t_sofar][p]);
				if(t_sofar==n) continue;
				rmax(dp[i+1][t_sofar+1][r],
					dp[i][t_sofar][p]+v[i]);
				
				
			}
		}
		
		ll need_r = targ%t;
		if(dp[n][t][need_r]>0){
			
			assert(dp[n][t][need_r]<=targ);
			//prin(t);
			//prin(dp[n][t][need_r]);
			assert((targ-dp[n][t][need_r])%t==0);
			rmin(ans, (targ-dp[n][t][need_r])/t);
		}
	}
	
	cout << ans << "\n";
}