#include<bits/stdc++.h>
#define MAXN 5000+10
#define MOD 998244353

using namespace std;

int n,m;
long long DP[MAXN][2];
long long a[MAXN][2];


int main()
{
	scanf("%d%d",&n,&m);
	long long Sum = 0;
	for(int i=1;i<=m;i++)
	{
		memset(a,0,sizeof(a));
		memset(DP,0,sizeof(DP));
		a[0][0] = 1;
		long long l = i-1;
		long long r = m - i; 
		for(int j=1;j<=n;j++)
		{
			DP[j][0]  = (DP[j][0] + DP[j-1][0] * l + DP[j-1][1] * l) % MOD;
			a[j][0] = (a[j][0] + a[j-1][0] * l + a[j-1][1] * l) % MOD;
			
			DP[j][1] = (DP[j][1] + DP[j-1][1] + DP[j-1][0] + a[j-1][0]) % MOD;
			a[j][1] = (a[j][1] + a[j-1][0] + a[j-1][1]) % MOD;
			
			DP[j][1] = (DP[j][1] + DP[j-1][1] * r) % MOD;
			a[j][1] = (a[j][1] + a[j-1][1] * r) % MOD;
			DP[j][0] = (DP[j][0] + DP[j-1][0] * r) % MOD;
			a[j][0] = (a[j][0] + a[j-1][0] * r) % MOD;
		}
		Sum = (Sum + DP[n][0] + DP[n][1]) % MOD; 
	}
	cout << Sum;
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int N=105;

ll n,x,a[N],dp[N][N][N];
ll k,ned;

ll cal(int i,int c,int mod){
    if(i==n){
        if(c==k && mod==ned)return 0;
        return -1e9;
    }
    if(dp[i][c][mod]!=-1)return dp[i][c][mod];
    ll sol=cal(i+1,c,mod);
    if(c+1<=k) sol=max(sol,cal(i+1,c+1,(mod+a[i])%k)+a[i]);
    return dp[i][c][mod]=sol;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin>>n>>x;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    ll ans=1e18;
    for(int i=1;i<=n;i++){
        memset(dp,-1,sizeof dp);
        k=i;
        ned=x%i;
        ll res=cal(0,0,0); 
        if(res<=0)continue;
        ll rem=x-res;
        ans=min(ans,rem/i);
    }
    cout<<ans<<'\n';
}