#include <bits/stdc++.h>
using namespace std;
char _;
const int maxN = 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
const int base = 701;
const int SQ = 500;
const int maxL = 20;
int a[maxN];
int n;
long long k;
int dif(int x, int t) {
  if (x % t) return t - x % t;
  return 0;
}
bool check(int t) {
  long long rem = 0;
  for (int i = 0; i < n; i++) rem += dif(a[i], t);
  return (rem <= k);
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  long long ans = 1;
  for (int i = 2; i <= 1000 * 1000; i++)
    if (check(i)) ans = i;
  for (int i = 1; i <= 1000; i++) {
    for (int j = 0; j < n; j++) {
      long long x = (a[j] + i - 1) / i;
      long long de = 0;
      int cng = 0;
      for (int k = 0; k < n; k++) {
        de += dif(a[k], x);
        cng += (a[k] + x - 1) / x;
      }
      if (de > k) continue;
      x += (k - de) / cng;
      ans = max(ans, x);
    }
  }
  cout << ans << endl;
  return 0;
}
