#include <bits/stdc++.h>
using namespace std;
template <typename Tp>
inline void read(Tp &x) {
  x = 0;
  int f = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  x *= f;
}
int buf[42];
template <typename Tp>
inline void write(Tp x) {
  int p = 0;
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  if (x == 0) {
    putchar('0');
    return;
  }
  while (x) {
    buf[++p] = x % 10;
    x /= 10;
  }
  for (int i = p; i; i--) putchar('0' + buf[i]);
}
const int N = 100 + 5;
const long long inf = 1e18;
long long maxa = 0;
long long n, k, suma = 0;
long long a[N];
int main() {
  read(n);
  read(k);
  for (int i = 1; i <= n; i++) read(a[i]);
  for (int i = 1; i <= n; i++) maxa = max(maxa, a[i]);
  for (int i = 1; i <= n; i++) suma += a[i];
  for (int i = 1; i <= n; i++) a[i]--;
  long long ans = 0;
  long long C = k + suma;
  for (long long l = 1, r = inf; l <= inf; l = r + 1) {
    r = inf;
    for (int i = 1; i <= n; i++) {
      if (a[i] < l)
        r = min(r, inf);
      else
        r = min(r, (a[i] / (a[i] / l)));
    }
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      sum += a[i] / l;
    }
    sum += n;
    long long maxd = C / sum;
    if (l <= maxd && maxd <= r) ans = max(ans, maxd);
  }
  write(ans);
  return 0;
}
