#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 20, B = 316277;
const long long inf = 1e13;
int n;
long long k;
long long a[N];
long long suf(long long x, long long y) {
  if (x < y) return inf;
  return x / (x / y);
}
int main() {
  scanf("%d%lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), a[i]--, k += a[i];
  sort(a + 1, a + n + 1);
  k += n;
  long long mx = -1;
  for (long long l = 1, r; l <= inf; l = r + 1) {
    long long sl = 0;
    r = suf(a[1], l);
    sl += a[1] / l;
    for (int i = 2; i <= n; i++) r = min(r, suf(a[i], l)), sl += a[i] / l;
    sl += n;
    long long t = min(r, k / sl);
    if (t < l)
      continue;
    else
      mx = max(mx, t);
  }
  printf("%lld\n", mx);
  return 0;
}
