#include <bits/stdc++.h>
using namespace std;
inline long long ceildiv(const long long& a, const long long& b) {
  return (a + b - 1) / b;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  set<long long> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    k += a[i];
    for (long long j = 1; j * j <= a[i]; j++) {
      s.insert(j);
      s.insert(ceildiv(a[i], j));
    }
  }
  vector<long long> aa;
  for (long long i : s) aa.push_back(i);
  aa.push_back(1e16);
  long long ans = -1;
  for (long long i = 0; i < aa.size() - 1; i++) {
    long long l = aa[i], r = aa[i + 1] - 1;
    long long s = 0;
    for (long long j : a) s += ceildiv(j, l);
    long long cn = k / s;
    if (cn < l || cn > r) continue;
    ans = max(ans, k / s);
  }
  cout << ans << "\n";
  return 0;
}
