#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define ALL(x) ((x).begin()), ((x).end())

#define READ(x) (cin >> (x))
#define WRITE_N(x) (cout << (x) << endl)
#define WRITE(x) (cout << (x))
#define WRITE_YESNO(x) (WRITE_N((x) ? "Yes" : "No"))

#define PRECISE_COUT std::cout << std::setprecision(15) << std::fixed

bool xor_logic(bool x, bool y) { return (x && y) || (!x && !y); }

set<int> solve(set<int> A, set<int> B) {
  set<int> retv;

  set<int> set_u;
  set_union(ALL(A), ALL(B), inserter(set_u, set_u.begin()));
  set<int> set_i;
  set_intersection(ALL(A), ALL(B), inserter(set_i, set_i.begin()));

  set_difference(ALL(set_u), ALL(set_i), inserter(retv, retv.begin()));
  return retv;
}

int main() {
  // get values from input
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N, M;
  set<int> A, B;

  cin >> N >> M;
  for (size_t i = 0; i < N; i++) {
    int A_i;
    cin >> A_i;
    A.insert(A_i);
  }
  for (size_t i = 0; i < M; i++) {
    int B_i;
    cin >> B_i;
    B.insert(B_i);
  }

  // main procedure
  set<int> ans = solve(A, B);

  // output
  for (auto &&x : ans) {
    cout << x << (x == *(ans.rbegin()) ? "\n" : " ");
  }

  return 0;
}
#include <bits/stdc++.h>

using namespace std;

const int N=105;

long long x;
int mem[N][N][N],vis[N][N][N],vid;
int arr[N];
int n,k;

int go(int ind,int rem,int remi)
{
	if(ind>=n) return (rem==0&&remi==0?0:-(1<<30));
	int &ret=mem[ind][rem][remi];
	if(vis[ind][rem][remi]==vid) return ret;
	vis[ind][rem][remi]=vid;	
	ret=max(arr[ind]+go(ind+1,(rem+k-arr[ind]%k)%k,remi-1),go(ind+1,rem,remi));
	return ret;
}

int main()
{
	scanf("%d %lld",&n,&x);
	for(int i=0;i<n;i++) scanf("%d",&arr[i]);
	long long ans=(1LL<<60);
	for(int i=1;i<=n;i++)
	{
		vid++;
		k=i;
		long long res=go(0,x%i,i);
		//cout << i << " " << res << endl;
		if(res>0) ans=min(ans,(x-res)/k);
	}
	printf("%lld\n",ans);
}