#include <bits/stdc++.h>
using namespace std;
long long n, k, ans, sum, a[101];
void check(long long t) {
  long long ret = 0;
  for (int i = 1; i <= n; ++i) {
    if (a[i] % t) ret += (a[i] / t + 1) * t - a[i];
  }
  if (ret <= k) ans = max(ans, t);
}
int main() {
  scanf("%lld%lld", &n, &k), sum += k;
  for (int i = 1; i <= n; ++i) {
    scanf("%lld", &a[i]), sum += a[i];
  }
  long long p = (long long)sqrt(sum);
  for (long long i = 1; i <= p; ++i) {
    if (sum / i > ans) check(sum / i);
    if (i > ans) check(i);
  }
  printf("%lld\n", ans);
  return 0;
}
