#include <bits/stdc++.h>
using namespace std;
const int N = 102;
const long long M = (long long)4e5;
int n;
long long a[N];
long long b[N];
long long k;
long long ans;
int main() {
  scanf("%d%lld", &n, &k);
  for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
  ans = 1;
  for (long long d = 2; d <= M; d++) {
    long long kk = k;
    for (int i = 0; i < n; i++) {
      if (a[i] % d != 0) kk -= d - (a[i] % d);
    }
    if (kk >= 0) ans = d;
  }
  long long maxD = 0;
  for (int i = 0; i < n; i++) maxD += a[i];
  maxD += k;
  maxD /= n;
  bool maxIsOk = true;
  for (int i = 0; i < n; i++) maxIsOk &= (a[i] <= maxD);
  if (maxIsOk) {
    printf("%lld\n", maxD);
    return 0;
  }
  long long curD = M;
  long long curK = 0;
  long long curSum = 0;
  set<pair<long long, int> > setik;
  for (int i = 0; i < n; i++) {
    b[i] = (a[i] + curD - 1) / curD;
    curSum += b[i];
    long long m = b[i] * curD - a[i];
    curK += m;
    if (b[i] == 1) continue;
    setik.insert(make_pair(curD + (curD - m + b[i] - 2) / (b[i] - 1), i));
  }
  while (curD < maxD && !setik.empty()) {
    if (curK <= k) ans = max(ans, curD + (k - curK) / curSum);
    pair<long long, int> cur = *setik.begin();
    setik.erase(setik.begin());
    long long nxtD = cur.first;
    curK += (nxtD - curD) * curSum;
    int id = cur.second;
    curD = nxtD;
    curK -= b[id] * curD - a[id];
    curSum -= b[id];
    b[id] = (a[id] + curD - 1) / curD;
    long long m = b[id] * curD - a[id];
    curK += m;
    curSum += b[id];
    if (b[id] == 1) continue;
    setik.insert(make_pair(curD + (curD - m + b[id] - 2) / (b[id] - 1), id));
  }
  printf("%lld\n", ans);
  return 0;
}
