#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 7;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const int mod = 1e9 + 7;
const double eps = 1e-8;
const double PI = acos(-1);
long long n, k, a[N], b[10000007], tar, tot;
int main() {
  scanf("%lld%lld", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    tar += a[i];
    a[i]--;
  }
  tar += k;
  for (int i = 1; i <= n; i++) {
    for (int j = 1, k; j < a[i]; j = k + 1) {
      k = a[i] / (a[i] / j);
      b[tot++] = j;
    }
    b[tot++] = a[i] + 1;
  }
  sort(b, b + tot);
  tot = unique(b, b + tot) - b;
  for (int i = tot - 1; i >= 0; i--) {
    long long d = b[i], val = 0;
    for (int i = 1; i <= n; i++) val += d * (a[i] / d);
    if (n * d + val <= tar) {
      val = 0;
      for (int i = 1; i <= n; i++) val += a[i] / d;
      printf("%lld\n", tar / (val + n));
      return 0;
    }
  }
  return 0;
}
