#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long int INF = 1e18;
map<int, long long int> add;
int v[200005];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, i;
  long long int k, d = 1, lo = 0, hi = INF, curr, mx = 0;
  cin >> n >> k;
  for (i = 0; i < n; i++) cin >> v[i];
  for (i = 0; i < n; i++) k += v[i];
  for (i = 0; i < n; i++) {
    mx = max(mx, v[i] * 1LL);
    for (int j = v[i]; j > 0;) {
      int t = (v[i] + j - 1) / j;
      int nxtj = (v[i] + t - 1) / t - 1;
      if (nxtj == 0) break;
      int nxtt = (v[i] + nxtj - 1) / nxtj;
      add[nxtj] += nxtt - t;
      j = nxtj;
    }
  }
  auto it = add.end();
  curr = n;
  while (it != add.begin()) {
    it--;
    lo = it->first + 1;
    long long int now = k / curr;
    now = min(now, hi);
    if (now >= lo) d = max(d, now);
    curr += it->second;
    hi = lo;
  }
  if (mx == 1) {
    cout << (k - n) / n + 1 << '\n';
    return 0;
  }
  cout << d << '\n';
  return 0;
}
