#include <bits/stdc++.h>
using namespace std;
const int MaxN = 1e5 + 23;
const int MOD = 1e9 + 7;
const int INF = 2e9 + 29;
int a[MaxN];
int n;
long long k;
vector<long long> v;
bool can(long long d) {
  if (d < 1) return false;
  long long res = 0;
  for (int i = 1; i <= n; ++i) res += (d - a[i] % d) % d;
  return res <= k;
}
void print(const vector<int>& v) {
  cout << v[0] << " - ";
  for (int i = 1; i < v.size(); ++i)
    if (v[i] - v[i - 1] > 1) {
      cout << v[i - 1] << '\n';
      cout << v[i] << " - ";
    }
  cout << v.back() << '\n';
}
void tryOne() {
  sort(a + 1, a + n + 1);
  long long cur = 0;
  for (int i = 1; i < n; ++i) cur += a[n] - a[i];
  if (cur <= k) {
    long long dif = (k - cur) / n;
    cout << a[n] + dif << '\n';
    exit(0);
  }
}
long long solve(long long l, long long r) {
  long long ans = l;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (can(mid)) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  return ans;
}
int main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  n = 100;
  k = 1e11;
  cin >> n >> k;
  for (int i = 1; i <= n; ++i) {
    a[i] = 1e7 * i;
    cin >> a[i];
    for (int k = 1; k <= 2000; ++k) {
      for (int j = -2; j <= 2; ++j) v.push_back(a[i] / k + j);
    }
  }
  tryOne();
  long long ans = 1;
  for (int i = 2; i <= 500000; ++i)
    if (can(i)) ans = i;
  sort(v.begin(), v.end());
  v.push_back(1e9 + 1);
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (int i = v.size() - 2; i >= 0; --i)
    if (can(v[i])) {
      long long cur = solve(v[i], v[i + 1]);
      if (cur > ans) ans = cur;
      break;
    }
  cout << ans << '\n';
}
