#include <bits/stdc++.h>

using namespace std;
namespace DEBUG {
    void __print(int x) {cerr << x;}
    void __print(long x) {cerr << x;}
    void __print(long long x) {cerr << x;}
    void __print(unsigned x) {cerr << x;}
    void __print(unsigned long x) {cerr << x;}
    void __print(unsigned long long x) {cerr << x;}
    void __print(float x) {cerr << x;}
    void __print(double x) {cerr << x;}
    void __print(long double x) {cerr << x;}
    void __print(char x) {cerr << '\'' << x << '\'';}
    void __print(const char *x) {cerr << '\"' << x << '\"';}
    void __print(const string &x) {cerr << '\"' << x << '\"';}
    void __print(bool x) {cerr << (x ? "true" : "false");}

    template<typename T, typename V>
    void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
    template<typename T>
    void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
    void _print() {cerr << "]\n";}
    template <typename T, typename... V>
    void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define rand __rand
    mt19937 generator(chrono::system_clock::now().time_since_epoch().count());
    template <class T = int>
    T rand(T range = numeric_limits <T> :: max()){
        return (T) (generator() % range);
    }
}
using namespace DEBUG;

template <class T,class U>
void maximize(T &lhs,U rhs){
    if(lhs < rhs)lhs = rhs;
}
template <class T,class U>
void minimize(T &lhs,U rhs){
    if(lhs > rhs)lhs = rhs;
}
template <class T>
T tabs(T x){
    return (x < (T)0 ? -x : x);
}

#define len(c) (int)((c).size())
#define llong int64_t
#define MASK(i) ((1LL) << (i))
#define BIT(x,i) (((x) >> (i)) & 1)
#define file_name "test"    /// FILE NAME HERE!!!

/* ================================= END OF TEMPLATE ================================= */

namespace Task{

    const llong INF = 1e18;
    class Solver{
        public:

            int n;
            llong X;
            vector < int > a;
            
            void solve(){
                cin>>n>>X;
                a.resize(n + 2,0);
                for(int i = 1;i <= n;++i){
                    cin>>a[i];
                }
                auto compute = [&](const int k) -> llong{
                    vector < vector < vector < llong > > > dp(n + 2,vector < vector < llong > > (k + 2,vector < llong > (k + 2,-INF)));
                    dp[0][0][0] = 0;
                    for(int i = 1;i <= n;++i){
                      for(int j = 1;j <= k;++j){
                        for(int m = 0;m < k;++m){
                            maximize(dp[i][j][m],dp[i - 1][j][m]);
                            int rm = ((m % k) - (a[i] % k) + k) % k;
                            maximize(dp[i][j][m],dp[i - 1][j - 1][rm] + (llong)a[i]);
                        }
                      }
                    }
                    return dp[n][k][X % k];
                };
                llong ans = INF;
                for(int i = 1;i <= n;++i){
                    llong S = compute(i);
                    if(S >= 0){
                        ans = min(ans,(X - S) / i);
                    }
                }
                cout<<ans<<'\n';
            }

            ~Solver(){} 
    };

    void solve(){
        int ntest = 1;
#ifndef  ONLINE_JUDGE
        ntest = 2; // single test to multitest.
#endif
        //cin>>ntest;  // multitest
        while(ntest--){
            Solver().solve();
        }
    }
}

int main(int argc, char** argv){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    #ifndef ONLINE_JUDGE
    freopen(file_name".inp","r",stdin);
    //freopen(file_name".out","w",stdout);	
    #endif // ONLINE_JUDGE
    Task::solve();
}


#include<bits/stdc++.h>
#define forn(i,s,t) for(register int i=(s);i<=(t);++i)
#define form(i,s,t) for(register int i=(s);i>=(t);--i)
using namespace std;
typedef long long LL;
const int N = 1e2+3;
const LL INF = 2e18;
template<typename T>inline T Max(T A, T B) {return A>B?A:B;}
template<typename T>inline T Min(T A, T B) {return A<B?A:B;}
LL a[N], f[N][N], X, Ans; int n;
int main() {
	scanf("%d%lld", &n, &X);
	forn(i,1,n) scanf("%lld", a+i);
	Ans = INF;
	forn(i,1,n) {
		forn(j,1,n) form(k,i-1,0) f[j][k] = -1;
		f[0][0] = 0;
		forn(j,1,n) form(k,i,0) forn(l,0,i-1) if(f[k][l] != -1) {
			LL tmp = f[k][l] + a[j];
			f[k+1][tmp % i] = Max(f[k+1][tmp % i], tmp);
		}
		if(f[i][X % i] != -1) Ans = Min(Ans, (X - f[i][X % i]) / i);
	}
	printf("%lld\n", Ans);
	return 0;
}