#include <bits/stdc++.h>
using namespace std;
const int N = 110, M = N * 60000;
long long k;
int A[N], val[M], n, m;
long long check(long long v) {
  long long ret = 0;
  for (long long i = 1; i <= n; i++) ret += A[i] % v == 0 ? 0 : v - A[i] % v;
  return ret;
}
int main() {
  cin >> n >> k;
  long long sum = 0;
  for (long long i = 1; i <= n; i++) cin >> A[i], sum += A[i];
  for (long long i = 1; i <= n; i++) {
    for (int j = A[i], nxt; j; j = nxt)
      nxt = A[i] / (A[i] / j + 1), val[++m] = j + bool(A[i] % j);
  }
  val[++m] = 1;
  sort(val + 1, val + m + 1), m = int(unique(val + 1, val + m + 1) - val) - 1;
  long long ans = 1;
  for (long long i = 1; i <= m; i++) {
    long long delt = 0, x = val[i], s = 0, nxt = i == m ? 1e18 : val[i + 1];
    for (long long j = 1; j <= n; j++) {
      delt += (A[j] - 1) / x + 1;
      s += A[j] % x ? x - A[j] % x : 0;
    }
    if (k >= s) ans = max(ans, min(x + (k - s) / delt, nxt - 1));
  }
  cout << ans << endl;
  return 0;
}
