#include <bits/stdc++.h>
using namespace std;
long long n, k;
int arr[300111];
int rem[10000000];
int ceil(int p, int q) { return (p + q - 1) / q; }
long long check(int val) {
  long long total = 0;
  for (int i = 1; i <= n; i++) {
    total += (long long)ceil(arr[i], val);
  }
  return total;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  long long sum = 0;
  int cnt = -1;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    sum += (long long)arr[i];
    for (int j = 1; j * j <= arr[i]; j++) {
      rem[++cnt] = j;
      rem[++cnt] = ceil(arr[i], j);
    }
  }
  sort(rem, rem + cnt);
  int sz = unique(rem, rem + cnt) - rem;
  long long ans = 1;
  for (int i = 0; i < sz; i++) {
    long long p = (sum + k) / check(rem[i]);
    if ((long long)rem[i] <= p) {
      ans = max(p, ans);
    }
  }
  cout << ans << endl;
  return 0;
}
