#include <bits/stdc++.h>
using namespace std;
long long m, n, q[100], w[100], ans = 1, v, u, x, y, bo;
int main() {
  scanf("%I64d%I64d", &n, &m);
  for (int i = 0; i < n; i++) scanf("%I64d", &q[i]);
  for (int i = 1;; i = v + 1) {
    bo = 1;
    for (int j = 0; j < n; j++) {
      w[j] = q[j] / i;
      if (w[j]) bo = 0;
    }
    v = 1e12;
    for (int j = 0; j < n; j++)
      if (w[j]) v = min(v, (q[j] / w[j]));
    u = m;
    for (int j = 0; j < n; j++) u = u - ((1 + w[j]) * v - q[j]) % v;
    if (u >= 0) ans = v;
    y = m;
    x = 0;
    for (int j = 0; j < n; j++) x += 1 + w[j], y += q[j];
    y /= x;
    if (y >= i && y < v) ans = max(ans, y);
    if (bo) break;
  }
  printf("%I64d\n", ans);
  return 0;
}
