#include <bits/stdc++.h>
using namespace std;
int ceil(int x, int y) {
  if (x % y == 0) return x / y;
  return x / y + 1;
}
signed main(void) {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if (fopen("A.INP", "r")) {
    freopen("A.INP", "r", stdin);
    freopen("A.OUT", "w", stdout);
  }
  if (fopen(""
            ".in",
            "r")) {
    freopen(
        ""
        ".in",
        "r", stdin);
    freopen(
        ""
        ".out",
        "w", stdout);
  }
  int n;
  long long k;
  cin >> n >> k;
  vector<int> a(n);
  vector<long long> seg;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    k += a[i];
    for (int j = 1; j * j <= a[i]; ++j) {
      seg.push_back(j);
      seg.push_back(ceil(a[i], j));
    }
  }
  sort(seg.begin(), seg.end());
  seg.erase(unique(seg.begin(), seg.end()), seg.end());
  long long res = 0;
  for (int i = 0; i < (int)seg.size(); ++i) {
    int l = seg[i];
    long long tmp = 0;
    for (int j = 0; j < n; ++j) {
      tmp += ceil(a[j], l);
    }
    long long d = k / tmp;
    if (l <= d) res = max(res, d);
  }
  cout << res << '\n';
}
