#include <bits/stdc++.h>
using namespace std;
const int maxN = 501000;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  vector<long long> events;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    k += a[i];
  }
  for (int i = 1; i < maxN; ++i) {
    events.push_back(i);
    events.push_back(k / i - 1);
    events.push_back(k / i);
  }
  sort(events.begin(), events.end());
  events.resize(unique(events.begin(), events.end()) - events.begin());
  reverse(events.begin(), events.end());
  long long res = 0;
  for (long long x : events) {
    if (x == 0) continue;
    long long cur = 0;
    for (long long num : a) {
      cur += (num + x - 1) / x;
    }
    if (cur <= k / x) {
      res = max(res, x);
    }
  }
  cout << res << endl;
  return 0;
}
