#include <bits/stdc++.h>
using namespace std;
const int maxN = 109;
const int INF = 1e9;
const long long INF1 = 1e12;
int a[maxN];
vector<long long> vt;
pair<bool, long long> bin(long long l, long long r, int n, long long k) {
  if (l == r) {
    return make_pair(false, l);
  }
  while (l + 1 != r) {
    long long m = (l + r) / 2;
    long long now = 0;
    for (int j = 0; j < n; j++) {
      long long res = a[j] / m;
      if (res * m != a[j]) {
        now += (res + 1) * m - a[j];
      }
    }
    if (now <= k) {
      l = m;
    } else {
      r = m;
    }
  }
  long long now = 0;
  for (int j = 0; j < n; j++) {
    int res = a[j] / l;
    if (res * l != a[j]) {
      now += (res + 1) * l - a[j];
    }
  }
  if (now <= k) {
    return make_pair(true, l);
  }
  return make_pair(false, l);
}
int main() {
  int n;
  long long k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int sq = sqrt(INF);
  long long mx = 1;
  for (int i = 2; i <= sq; i++) {
    long long now = 0;
    for (int j = 0; j < n; j++) {
      long long res = a[j] / i;
      if (res * i != a[j]) {
        now += (res + 1) * i - a[j];
      }
    }
    if (now <= k) {
      mx = i;
    }
  }
  for (int j = 0; j < n; j++) {
    for (int i = 1; i <= sq; i++) {
      if (a[j] / i > 0) {
        vt.push_back(a[j] / i);
      }
    }
  }
  vt.push_back(INF1);
  sort(vt.begin(), vt.end());
  for (size_t i = 1; i < vt.size(); i++) {
    auto res = bin(vt[i - 1], vt[i], n, k);
    if (res.first) {
      mx = res.second;
    }
  }
  cout << mx;
  return 0;
}
