#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 100 + 10;
long long n, k;
long long a[MAXN];
long long b[MAXN];
bool check(long long x) {
  long long res = 0;
  for (long long i = 0; i < n; i++) {
    res += ((a[i] + x - 1) / x) * x - a[i];
  }
  return res <= k;
}
long long ce(long long a, long long b) { return (a + b - 1) / b; }
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  set<long long> S;
  for (long long i = 0; i < n; i++) {
    long long s = 0;
    while (s * s < a[i]) s++;
    long long last = -1;
    for (long long j = 1; j <= s; j++) {
      if (ce(a[i], j) != last) {
        S.insert(j);
      }
      last = ce(a[i], j);
    }
    for (long long j = 1; j <= s; j++) {
      long long z = ce(a[i], j);
      S.insert(z);
    }
  }
  vector<long long> v;
  for (auto x : S) v.push_back(x);
  long long infff = 10000000LL;
  infff *= infff;
  v.push_back(infff);
  long long res = 0;
  for (long long i = 0; i + 1 < v.size(); i++) {
    long long p = v[i];
    long long q = v[i + 1];
    for (long long j = 0; j < n; j++) b[j] = ce(a[j], p);
    long long s = 0;
    long long r = 0;
    for (long long j = 0; j < n; j++) r += b[j] * p - a[j], s += b[j];
    if (r > k) continue;
    long long dx = (k - r) / s;
    res = max(res, min(p + dx, q - 1));
  }
  cout << res << "\n";
  return 0;
}
