#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
int n;
long long k;
long long int a[maxn];
long long int sum;
int check(long long int mid) {
  long long temp = sum / mid;
  long long res = 0;
  for (int i = 0; i < n; i++) {
    res += a[i] / mid;
    if (a[i] % mid) res++;
  }
  return res <= temp;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sum = k;
  for (int i = 0; i < n; i++) sum += a[i];
  long long int i, j;
  j = 1;
  long long ans = 0;
  for (i = 1; i <= sum; i = j + 1) {
    j = sum / (sum / i);
    if (check(j)) ans = j;
  }
  cout << ans << endl;
  return 0;
}
