#include <bits/stdc++.h>
using namespace std;
long long an = 1, k;
map<long long, long long> vis;
int x[100], n, lm = 100000, c[100];
long long up(long long z) {
  map<long long, long long>::iterator it = vis.find(z);
  if (it != vis.end()) return it->second;
  long long s = 0;
  for (int i = 0; i < (int)(n); ++i) {
    long long w = x[i] % z;
    w = z - w;
    if (w == z) w = 0;
    s += w;
  }
  if (s <= k) an = max(an, z);
  if (z > lm) vis[z] = s;
  return s;
}
int main() {
  scanf("%d%lld", &n, &k);
  long long mx = 0;
  for (int i = 0; i < (int)(n); ++i)
    scanf("%d", x + i), mx = max(mx, (long long)x[i]);
  if (up(mx) <= k) {
    long long s = 0;
    for (int i = 0; i < (int)(n); ++i) {
      int w = x[i] % mx;
      w = mx - w;
      if (w == mx) w = 0;
      s += w;
    }
    k -= s;
    mx += k / n;
    printf("%lld\n", mx);
    return 0;
  }
  for (int i = 1; i < (int)(lm + 1); ++i) up(i);
  vector<pair<int, pair<int, int> > > v;
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 1; j * j <= x[i]; ++j) {
      int k = (x[i] + j - 1) / j;
      if (k <= lm) break;
      v.push_back(make_pair(k, make_pair(i, j + 1)));
    }
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  long long s = n;
  for (int i = 0; i < (int)(n); ++i) c[i] = 1;
  for (int i = 0; i < (int)(v.size()); ++i) {
    long long sm = up(v[i].first);
    int j = v[i].second.first;
    if (sm <= k) {
      long long tk = k - sm;
      long long nxt = v[i].first + tk / s;
      up(min(nxt, i ? (long long)v[i - 1].first : (long long)2e9));
    }
    s += v[i].second.second - c[j];
    c[j] = v[i].second.second;
  }
  printf("%lld\n", an);
}
