#include "bits/stdc++.h"
using namespace std; 
#define for_(i, s, e) for (int i = s; i < (int) e; i++)
#define for__(i, s, e) for (ll i = s; i < e; i++)
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
#define endl '\n'

// if two adjacent nodes have same reachability, then they are in SCC
// now we have a DAG to solve with
// if two adjacent nodes have different reachability, then their direction is easily found
// reduced to making graph SCC by directing edges
// read CF blog post for details on how to do that (is-this-fft)

int n, m;
vector<vector<ii>> adj;
vector<ii> ans;
vi vis;

int dfs(int p, int parent) {
	if (vis[p]) return 1;
	vis[p] = 1;
	
	for (auto i: adj[p]) if (i.first != parent and ans[i.second].first == -1) {
		int v = dfs(i.first, p);
		// cout << "going edge " << p << " - " << i.first << " ... " << v << endl;
		ans[i.second] = {i.first, p};
		// if (v) ans[i.second] = {p, i.first};
	}
	
	vis[p] = 2;
	return 0;
}

int main() {
	#ifdef mlocal
	freopen("test.in", "r", stdin);
	#endif
	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	cin >> n >> m;
	vector<ii> edges(m);
	adj.resize(n); ans.resize(m, {-1, -1}); vis.resize(n);
	
	for_(i, 0, m) {
		int a, b; cin >> a >> b;
		a -= 1; b -= 1;
		adj[a].push_back({b, i}); adj[b].push_back({a, i});
		edges[i] = {a, b};
	}
	
	vi reach(n);
	for_(i, 0, n) cin >> reach[i];
	for_(i, 0, m) if (reach[edges[i].first] != reach[edges[i].second]) {
		ans[i] = {edges[i].first, edges[i].second};
		if (reach[edges[i].first] < reach[edges[i].second]) ans[i] = {edges[i].second, edges[i].first};
	}
	
	for_(i, 0, n) if (!vis[i]) dfs(i, i);
	
	for_(i, 0, m) {
		if (edges[i] == ans[i]) cout << "->";
		else cout << "<-";
		cout << endl;
	}
	
	

	return 0;
}
#include <bits/stdc++.h>
typedef long long int ll;
#define INF 1e18
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    ll x;
    cin >>  n >> x;
    vector<int> arr(n);
    for(int i=0;i<n;i++){
        cin >> arr[i];
    }
    ll res=INF;
    for(int k=1;k<=n;k++){

        vector<vector<int>> dp(k+1,vector<int> (k,-1));
        dp[0][0]=0;
        for(int i=1;i<=n;i++){
            for(int j=k;j>=1;j--){
                for(int r=0;r<k;r++){
                    if(dp[j-1][r]==-1){
                        continue;
                    }
                    int next=dp[j-1][r]+arr[i-1];
                    dp[j][next%k]=max(dp[j][next%k],next);
                }
            }
        }
        // cout << "k= " << k << " " << dp[k][x%k] <<  "\n";

        if(dp[k][x%k]!=-1){
            res=min(res,(x-dp[k][x%k])/k);
        }
    }
    cout << res << "\n";
    return 0;
}