#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
int main() {
  int n;
  long long k;
  scanf("%d%lld", &n, &k);
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    k += a[i];
  }
  int lim = 1e5;
  long long best = 0;
  for (long long j = 1; j < lim; ++j) {
    long long sum = 0;
    for (int i = 0; i < n; ++i) {
      sum += (a[i] + j - 1) / j * j;
    }
    if (sum <= k) best = j;
  }
  for (long long j = lim, nxt_j; j < (1LL << 50); j = nxt_j + 1) {
    nxt_j = 1LL << 50;
    long long sum = 0;
    for (int i = 0; i < n; ++i) {
      int cur = (a[i] + j - 1) / j;
      sum += cur;
      if (cur > 1) {
        nxt_j = min(nxt_j, (long long)(a[i] - 1) / (cur - 1));
      }
    }
    long long cur = k / sum;
    if (cur >= j && cur <= nxt_j) best = cur;
  }
  printf("%lld\n", best);
  return 0;
}
