#include <bits/stdc++.h>
using namespace std;
int N;
long long K;
vector<long long> arr;
vector<long long> le, ri;
int main() {
  scanf("%d %lld", &N, &K);
  arr.resize(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &arr[i]);
  }
  long long ans = 1;
  for (int d = 2; d <= 100010; d++) {
    long long sum = 0;
    for (int j = 0; j < N; j++) {
      long long q = (arr[j] + d - 1) / d;
      sum += q * d - arr[j];
    }
    if (sum <= K) ans = d;
  }
  for (int i = 0; i < N; i++) {
    for (int j = 1; j <= 10010; j++) {
      long long s = 1, e = 1e15;
      long long x = -1;
      while (s <= e) {
        long long m = (s + e) >> 1;
        if ((arr[i] + m - 1) / m >= j) {
          x = m;
          s = m + 1;
        } else
          e = m - 1;
      }
      if (x != -1) ri.push_back(x);
    }
  }
  ri.push_back(0);
  ri.push_back(1e15);
  sort(ri.begin(), ri.end());
  ri.resize(unique(ri.begin(), ri.end()) - ri.begin());
  for (int i = 0; i < (int)ri.size() - 1; i++) {
    long long s = ri[i] + 1;
    long long e = ri[i + 1];
    long long t = s;
    long long sum = 0;
    long long qsum = 0;
    for (int j = 0; j < N; j++) {
      long long q = (arr[j] + t - 1) / t;
      sum += q * t - arr[j];
      qsum += q;
    }
    long long x = -1;
    while (s <= e) {
      long long m = (s + e) >> 1;
      if (sum + (m - t) * qsum <= K) {
        x = m;
        s = m + 1;
      } else
        e = m - 1;
    }
    ans = max(ans, x);
  }
  printf("%lld", ans);
}
