#include<cstdio>
#include<cstring>
#include<queue>
#include<cmath>
#include<algorithm>
using namespace std;
typedef int int_;
#define int long long
#define maxn 400010
const int inf=1e9+7;
queue<int> q;
inline int read(){
	int ret=0,ff=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') ff=-ff;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		ret=ret*10+ch-'0';
		ch=getchar();
	}
	return ret*ff;
}
struct Edge{
	int u,v,w,next;
}E[maxn<<1];
int ecnt=0,head[maxn];
int in[maxn];
void addedge(int u,int v){
	++in[v];
	E[++ecnt].u=u;
	E[ecnt].v=v;
	E[ecnt].next=head[u];
	head[u]=ecnt;
}
void Addedge(int u,int v){
	addedge(u,v);
	addedge(v,u);
}
int gcd(int a,int b){
	return b?gcd(b,a%b):a;
}
int ksm(int a,int b,int p){
	int ret=1;
	while(b){
		if(b&1) ret=ret*a%p;
		a=a*a%p;
		b>>=1;
	}
	return ret%p;
}
bool cmp(int x,int y){
	return x>y;
}
int a[10010];
int G2(int x){
	int cnt=0;
	while(x){
		a[++cnt]=x%10;
		x/=10;
	}
	sort(a+1,a+1+cnt);
	int ret=0;
	for(int i=1;i<=cnt;++i) ret=ret*10+a[i];
	return ret;
}
int G1(int x){
	int cnt=0;
	while(x){
		a[++cnt]=x%10;
		x/=10;
	}
	sort(a+1,a+1+cnt,cmp);
	int ret=0;
	for(int i=1;i<=cnt;++i) ret=ret*10+a[i];
	return ret;
}
int F(int x){
	return G1(x)-G2(x);
}
char X[10010];
bool ck(int Mid,int len,int m){
	int sum=0,tmp=1;
	for(int j = len; j;--j){
		sum+=tmp*(X[j]-'0');
		tmp*=Mid;		
	}
	return sum>m;
}
int dp[2][110][110][110];
int_ main(){
	int n=read(),x=read();
	for(int i=1;i<=n;++i) a[i]=read();
	memset(dp, -1, sizeof dp);
	for(int i=1;i<=n;i++) dp[0][i][0][0] = 0;
	for(int i=0;i<n;i++){
		int qwq=i&1;
		for(int j =1;j<=n;j++){
			for(int qaq =0;qaq<=i;qaq++){
				for(int res=0;res<j;res++){
					if(dp[qwq][j][qaq][res]==-1) continue;
					dp[qwq^1][j][qaq+1][(res+a[i+1])%j]=max(dp[qwq^1][j][qaq+1][(res+a[i+1])%j],dp[qwq][j][qaq][res]+a[i+1]);
					dp[qwq^1][j][qaq][res]=max(dp[qwq^1][j][qaq][res], dp[qwq][j][qaq][res]);
				}
			}
		}
	}
	int qwq=n&1,ans=x;
	for(int qaq=1;qaq<=n;qaq++){
		if(dp[qwq][qaq][qaq][x%qaq]>0&&x>=dp[qwq][qaq][qaq][x%qaq])ans=min(ans,(x-dp[qwq][qaq][qaq][x%qaq])/qaq);	
	}
	printf("%lld",ans);
	return 0;
}
/*
1
6 3
*/
/*
111111111111111111111111111111111111111111111111111111111111
1000000000000000000

100000000000000000000000000000000000000000000000000000000000

1000000000000000000
2
1000000000000000000
*/
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline int my_getchar(){
  static char buf[1048576];
  static int s = 1048576;
  static int e = 1048576;
  if(s == e && e == 1048576){
    e = fread(buf, 1, 1048576, stdin);
    s = 0;
  }
  if(s == e){
    return EOF;
  }
  return buf[s++];
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void rd(long long &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = my_getchar();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = my_getchar();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
struct MY_WRITER{
  char buf[1048576];
  int s;
  int e;
  MY_WRITER(){
    s = 0;
    e = 1048576;
  }
  ~MY_WRITER(){
    if(s){
      fwrite(buf, 1, s, stdout);
    }
  }
}
;
MY_WRITER MY_WRITER_VAR;
void my_putchar(int a){
  if(MY_WRITER_VAR.s == MY_WRITER_VAR.e){
    fwrite(MY_WRITER_VAR.buf, 1, MY_WRITER_VAR.s, stdout);
    MY_WRITER_VAR.s = 0;
  }
  MY_WRITER_VAR.buf[MY_WRITER_VAR.s++] = a;
}
inline void wt_L(char a){
  my_putchar(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    my_putchar('-');
  }
  while(s--){
    my_putchar(f[s]+'0');
  }
}
template<class S, class T> inline S chmin(S &a, T b){
  if(a>b){
    a=b;
  }
  return a;
}
template<class S, class T> inline S chmax(S &a, T b){
  if(a<b){
    a=b;
  }
  return a;
}
int N;
long long X;
long long A[110];
long long f[110][110];
int main(){
  int k;
  rd(N);
  rd(X);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=(0);Lj4PdHRW<(N);Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
    }
  }
  long long ans = 4611686016279904256LL;
  for(k=(1);k<(N+1);k++){
    int i, j;
    for(j=(0);j<(k+1);j++){
      int l;
      for(l=(0);l<(k+1);l++){
        f[j][l] = -4611686016279904256LL;
      }
    }
    f[0][0] = 0;
    for(i=(0);i<(N);i++){
      for(j=(k)-1;j>=(0);j--){
        int l;
        for(l=(0);l<(k);l++){
          if(f[j][l] < 0){
            continue;
          }
          chmax(f[j+1][(l + A[i])%k], f[j][l] + A[i]);
        }
      }
    }
    if(f[k][X%k] < 0){
      continue;
    }
    chmin(ans, (X-f[k][X%k])/k);
  }
  wt_L(ans);
  wt_L('\n');
  return 0;
}
// cLay version 20210103-1

// --- original code ---
// //no-unlocked
// int N;
// ll X, A[110], f[110][110];
// {
//     rd(N,X, A(N));
//     ll ans = ll_inf;
//     rep(k,1,N+1){
//         rep(j, k+1)
//             rep(l, k+1)
//                 f[j][l] = -ll_inf;
//         f[0][0] = 0; 
//         rep(i, N)
//             rrep(j, k)
//                 rep(l, k)
//                 {
//                     if(f[j][l] < 0) continue;
//                     f[j+1][(l + A[i])%k] >?= f[j][l] + A[i]; 
//                 }
//         if(f[k][X%k] < 0)
//             continue;
//         ans <?= (X-f[k][X%k])/k;
//     }
//     wt(ans);
// }