#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-8;
const double PI = acos(-1.0);
const long long MOD = 1e9 + 7;
const int INF = 0x3f3f3f3f;
const long long LL_INF = 0x3f3f3f3f3f3f3f3f;
long long n, k;
long long num[105];
int main() {
  while (scanf("%I64d%I64d", &n, &k) != EOF) {
    long long da = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%I64d", &num[i]);
      da = max(da, num[i]);
    }
    long long tempk = k;
    long long ans = 0;
    for (int i = 1; i <= n; i++) tempk += num[i];
    long long r;
    for (long long i = 1; i <= da; i = r + 1) {
      r = LL_INF;
      for (int j = 1; j <= n; j++) {
        if (i <= num[j]) r = min(r, (num[j] - 1) / (num[j] / i) + 1);
      }
      i = r;
      long long temp = 0;
      for (int j = 1; j <= n; j++)
        temp = temp + ((num[j] - 1) / i + 1) * i - num[j];
      if (temp <= k) ans = max(ans, i);
    }
    long long T = 0, cal = 0;
    for (int i = 1; i <= n; i++) T += (num[i] - 1) / ans + 1;
    for (int i = 1; i <= n; i++)
      cal = cal + ((num[i] - 1) / ans + 1) * ans - num[i];
    printf("%I64d\n", ans + (k - cal) / T);
  }
  return 0;
}
