#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e2 + 10;
long long a[MAXN];
vector<long long> v;
int32_t main() {
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long ans = 0;
  for (long long i = 1; i <= 1e6; i++) {
    long long sum = 0;
    for (long long j = 0; j < n; j++) sum += (a[j] + i - 1) / i * i - a[j];
    if (sum <= k) ans = max(ans, (long long)i);
  }
  for (long long i = 0; i < n; i++) {
    for (long long j = min((long long)1010, a[i]); j > 0; j--) {
      long long num = a[i] / j;
      if ((a[i] + num - 1) / num != j) num++;
      v.push_back(num);
    }
    v.push_back(a[i] + 1);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  for (long long i = 0; i < (long long)v.size(); i++) {
    long long sum = 0, num = v[i], total = 0;
    for (long long j = 0; j < n; j++) {
      long long m = (a[j] + num - 1) / num;
      sum += m * num - a[j];
      total += m;
    }
    long long nxt = 1e12;
    if (i != (long long)v.size() - 1) nxt = v[i + 1];
    if (sum <= k) {
      ans = max(ans, num + min((k - sum) / total, nxt - num - 1));
    }
  }
  cout << ans << endl;
}
