#include <bits/stdc++.h>
using namespace std;
long long n, k, a[20000], ans = 0;
bool ok(long long x) {
  long long re = 0;
  for (long long i = 1; i <= n; i++) re += (a[i] - 1) / x + 1;
  return re * x <= k;
}
int main() {
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i], k += a[i];
  for (long long i = sqrt(k); i >= 1; i--) {
    if (ok(i)) ans = max(ans, i);
    if (ok(k / i)) ans = max(ans, k / i);
  }
  cout << ans << endl;
  return 0;
}
