#include <bits/stdc++.h>
using namespace std;
using seq = vector<int64_t>;
int64_t n, k, a[100];
seq sep[100], D{1};
seq unite(seq a, seq b) {
  seq c(a.size() + b.size());
  c.resize(set_union(a.begin(), a.end(), b.begin(), b.end(), c.begin()) -
           c.begin());
  return c;
}
seq jumps(int a) {
  seq res;
  for (int d = 1; d < a - 1;)
    d = (a + d) / (d + 1), d = (a + d - 2) / (d - 1) - 1, res.push_back(d);
  return res;
}
int64_t eval(int64_t d) {
  int64_t res = 0;
  for (int i = 0; i < n; ++i) res += d - 1 - (a[i] - 1) % d;
  return res;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; ++i) cin >> a[i];
  transform(a, a + n, sep, jumps);
  D = accumulate(sep, sep + n, D, unite);
  D.push_back(D.back() + k + 1);
  for (int i = D.size() - 1; i; --i) {
    if (D[i - 1] + 1 == D[i])
      if (eval(D[i]) <= k)
        return cout << D[i], 0;
      else
        continue;
    int64_t ld = D[i - 1] + 1, rd = D[i], l, r, step, fix;
    l = eval(ld);
    r = eval(rd);
    step = (r - l) / (rd - ld);
    fix = (r - k + step - 1) / step;
    if (rd - fix >= ld) return cout << rd - fix, 0;
  }
  cout << 1;
  return 0;
}
