#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.14159265358979323846264338327950288419716939937510582097494459230;
template <typename T>
inline T gcd(T a, T b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
template <typename T>
inline void amin(T& x, T y) {
  if (x > y) x = y;
}
template <typename T>
inline void amax(T& x, T y) {
  if (x < y) x = y;
}
void preprocess(void) { return; }
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.precision(20);
  preprocess();
  int t;
  t = 1;
  for (int z = (1); z <= (t); z++) {
    long long n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = (0); i <= ((int)(n)-1); i++) {
      cin >> a[i];
      k += a[i];
    }
    vector<long long> ds;
    ds.push_back(1);
    for (int i = (0); i <= ((int)(n)-1); i++) {
      for (int j = 1; j * j <= a[i]; j++) {
        ds.push_back(j);
        ds.push_back((a[i] + j - 1) / j);
      }
    }
    sort(ds.begin(), ds.end());
    ds.erase(unique(ds.begin(), ds.end()), ds.end());
    ;
    long long ans = 0;
    for (auto it : (ds)) {
      long long tans = 0;
      for (int i = (0); i <= ((int)(n)-1); i++) {
        tans += (a[i] + it - 1) / it;
      }
      tans = k / tans;
      if (it <= tans) {
        if (tans > ans) {
          ans = tans;
        }
      };
    }
    cout << ans << endl;
  }
  return 0;
}
