#include <bits/stdc++.h>
using namespace std;
int ceiling(int a, int b) { return ((a + b - 1) / b); }
vector<pair<int, int> > floorEqualRanges(int n) {
  vector<pair<int, int> > ans;
  for (int l = 1, r; l <= n; l = r + 1) {
    r = n / (n / l);
    ans.emplace_back(l, r);
  }
  return ans;
}
vector<pair<int, int> > ceilEqualRanges(int n) {
  return floorEqualRanges(n - 1);
}
template <class F>
int search(int l, int r, F test) {
  r++;
  while (r - l > 1) {
    int m = l + r >> 1;
    if (test(m))
      l = m;
    else
      r = m;
  }
  return test(l) ? l : l - 1;
}
int main() {
  int n;
  long long k;
  cin >> n >> k;
  vector<int> a(n);
  int best = 0;
  long long waste = 0, num = k;
  for (int& x : a) {
    cin >> x;
    waste -= x;
    num += x;
    best = max(best, x);
  }
  waste += (long long)best * n;
  if (waste <= k) {
    cout << best + (k - waste) / n << '\n';
  } else {
    vector<int> v;
    for (int x : a) {
      for (auto [l, r] : ceilEqualRanges(x)) {
        v.push_back(l);
      }
      v.push_back(x);
    }
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    int ans = 0;
    for (int i = 1; i < v.size(); i++) {
      int l = v[i - 1], r = v[i] - 1;
      long long den = 0;
      for (int x : a) den += ceiling(x, l);
      int d = search(l, r, [&](long long d) { return d * den <= num; });
      if (d != l - 1) ans = max(ans, d);
    }
    cout << ans << '\n';
  }
}
