#include <bits/stdc++.h>
using namespace std;
int n;
long long k, a[105];
long long cal(long long num) {
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] % num > 0) ans += (a[i] / num + 1) * num - a[i];
  return ans;
}
int main() {
  int i;
  scanf("%d%lld", &n, &k);
  for (i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long l = 1ll, r = 100000000001ll, b = 1ll;
  for (long long o = 1000000; o >= 1ll; o /= 10ll) {
    for (long long i = l; i <= r; i += o) {
      long long p = cal(i);
      if (p <= k && i >= b) {
        b = i;
      }
    }
    l = b;
    r = b + o * 10000;
  }
  printf("%lld\n", b);
}
