#include <bits/stdc++.h>
using namespace std;
long long n, k, ma, a[101], ans, sum;
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];
  }
  for (long long i = 1; i * i <= sum; ++i) {
    if (i > ans) check(i);
    if (sum / i > ans) check(sum / i);
  }
  printf("%lld\n", ans);
  return 0;
}
