#include <bits/stdc++.h>
using namespace std;
const int maxn = 109;
long long a[maxn], n, K, sum, ans;
bool check(long long x) {
  long long res = 0;
  for (int i = 1; i <= n; i++) res += (a[i] + x - 1) / x * x - a[i];
  return res <= K;
}
int main() {
  scanf("%I64d%I64d", &n, &K);
  sum = K;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    sum += a[i];
  }
  for (long long i = 1; i <= sum; i++) {
    i = sum / (sum / i);
    if (check(i)) ans = i;
  }
  printf("%I64d\n", ans);
  return 0;
}
