#include <bits/stdc++.h>
using namespace std;
const int SZ = 200000;
int n;
long long a[105], k, s;
bool go(int d) {
  s = 0;
  for (int i = 0; i < n; i++) {
    int z = d - (a[i] % d);
    if (z == d) z = 0;
    s += z;
  }
  return s <= k;
}
int main() {
  scanf("%d%lld", &n, &k);
  long long ma = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    if (a[i] > ma) ma = a[i];
  }
  long long k2 = 0, ans = 1;
  for (int i = 0; i < n; i++) k2 += ma - a[i];
  if (k2 <= k) {
    k -= k2;
    ans = ma + k / n;
  } else {
    for (int d = 2; d <= SZ; d++)
      if (go(d)) ans = d;
    vector<int> chk;
    for (int i = 0; i < n; i++) {
      for (int j = 1; j <= SZ; j++) {
        int d = (a[i] - 1) / j + 1;
        if (d <= SZ) break;
        chk.push_back(d);
      }
    }
    sort(chk.begin(), chk.end());
    for (int i = 0; i < chk.size(); i++) {
      if (i > 0 && chk[i] == chk[i - 1]) continue;
      if (go(chk[i])) ans = chk[i];
    }
    int z = 1 << 30;
    while (z) {
      if (go(ans + z)) ans += z;
      z >>= 1;
    }
  }
  printf("%lld\n", ans);
}
