#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  long long best = 0;
  vector<long long> td;
  for (long long d = 1; d <= 500000; d++) td.push_back(d);
  vector<long long> cd;
  for (long long i = 0; i < n; i++) {
    for (long long c = 1; c <= 2000; c++) {
      cd.push_back(a[i] / c);
    }
  }
  cd.push_back(500000);
  for (long long i = 0; i < cd.size(); i++) {
    long long d = cd[i];
    if (d <= 0) continue;
    td.push_back(d);
    long long ksum = 0;
    long long asum = 0;
    for (long long f = 0; f < n; f++) {
      ksum += (a[f] + d - 1) / d;
      asum += a[f];
    }
    td.push_back((k + asum) / ksum);
  }
  for (long long tt = 0; tt < td.size(); tt++) {
    long long d = td[tt];
    if (d <= 0LL) continue;
    long long cur = 0;
    for (long long i = 0; i < n; i++) {
      cur += (d - a[i] % d) % d;
    }
    if (cur <= k) {
      best = max(d, best);
    }
  }
  cout << best << endl;
}
