#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
const int M = 110;
int n;
long long k;
long long C;
struct VC : vector<long long> {
  void done() {
    sort(begin(), end());
    erase(unique(begin(), end()), end());
  }
} ss;
long long a[M];
void work(long long n) {
  ss.emplace_back(n);
  for (long long i = 1; i < n;) {
    if (n % i == 0) {
      long long x = n / i - 1;
      long long r = n / x;
      if (n % x == 0) --r;
      ss.emplace_back(r);
      i = r + 1;
    } else {
      long long x = n / i;
      long long r = n / x;
      if (n % x == 0) --r;
      ss.emplace_back(r);
      i = r + 1;
    }
  }
}
int main() {
  while (~scanf("%d%I64d", &n, &k)) {
    ss.clear();
    for (int i = 0; i < n; ++i) {
      scanf("%I64d", a + i);
      work(a[i]);
    }
    ss.emplace_back(inf);
    ss.done();
    C = k + accumulate(a, a + n, 0ll);
    long long lst = 0;
    long long maxn = 1;
    for (long long &v : ss) {
      long long sum = 0;
      for (int i = 0; i < n; ++i) {
        long long f = a[i] / v;
        if (f * v < a[i]) ++f;
        sum += f;
      }
      long long l = lst + 1, r = v;
      long long ret = -1;
      while (l <= r) {
        long long mid = l + r >> 1;
        if (mid * sum <= C)
          ret = mid, l = mid + 1;
        else
          r = mid - 1;
      }
      maxn = max(maxn, ret);
      lst = v;
    }
    printf("%I64d\n", maxn);
  }
}
