#include <bits/stdc++.h>
using namespace std;
const int N = 100000 + 5;
long long n, a[N], k, d, ans;
bool check(long long d) {
  long long res = 0;
  for (int i = 1; i <= n; i++) res += (a[i] - 1 + d) / d;
  return res * d <= k;
}
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i], k += a[i];
  long long l = 1, r = k;
  for (long long i = 1; i <= sqrt(k); i++) {
    if (check(i)) ans = max(ans, i);
    if (check(k / i)) ans = max(ans, k / i);
  }
  cout << ans << endl;
  return 0;
}
