#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O2")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
const long long mod = 1e9 + 7;
const long long int special_prime = 982451653;
using namespace std;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while (!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(vector<string> __attribute__((unused)) args,
               __attribute__((unused)) int idx,
               __attribute__((unused)) int LINE_NUM) {
  cerr << endl;
}
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if (idx > 0)
    cerr << ", ";
  else
    cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss;
  ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
template <class T, class U>
istream &operator>>(istream &in, pair<T, U> &rhs) {
  in >> rhs.first;
  in >> rhs.second;
  return in;
}
template <class T, class U>
ostream &operator<<(ostream &out, const pair<T, U> &rhs) {
  out << rhs.first;
  out << " ";
  out << rhs.second;
  return out;
}
template <class T, class U>
pair<T, U> operator+(pair<T, U> &a, pair<T, U> &b) {
  return pair<T, U>(a.first + b.first, a.second + b.second);
}
template <class T, class U>
pair<T, U> operator-(pair<T, U> &a, pair<T, U> &b) {
  return pair<T, U>(a.first - b.first, a.second - b.second);
}
template <class T>
istream &operator>>(istream &in, vector<T> &a) {
  for (auto &i : a) cin >> i;
  return in;
}
template <class T>
ostream &operator<<(ostream &out, const vector<T> &a) {
  for (auto &i : a) cout << i << " ";
  return out;
}
template <class T>
ostream &operator<<(ostream &out, const set<T> &a) {
  for (auto &i : a) cout << i << " ";
  return out;
}
template <class T>
ostream &operator<<(ostream &out, const unordered_set<T> &a) {
  for (auto &i : a) cout << i << " ";
  return out;
}
template <class T>
ostream &operator<<(ostream &out, const multiset<T> &a) {
  for (auto &i : a) cout << i << " ";
  return out;
}
template <class T, class U>
ostream &operator<<(ostream &out, const map<T, U> &a) {
  for (auto &i : a) cout << "(" << i.first << ", " << i.second << ")\n";
  return out;
}
template <class T, class U>
ostream &operator<<(ostream &out, const unordered_map<T, U> &a) {
  for (auto &i : a) cout << "(" << i.first << ", " << i.second << ")\n";
  return out;
}
const long long N = 3e5 + 100;
const long long inf = 1e9;
const long double pi = acos(-1);
void solve(int test_case) {
  long long int n, k;
  cin >> n >> k;
  vector<long long int> a(n);
  cin >> a;
  long long int ans = 0;
  vector<vector<long long int>> same_d(n);
  k += accumulate(a.begin(), a.end(), 0LL);
  for (int j = 0; j < n; j++) {
    long long int s = a[j];
    for (long long int i = 1; i * i <= s; ++i) {
      same_d[j].emplace_back(i);
      same_d[j].emplace_back((s + i - 1) / i);
    }
  }
  set<long long int> arr;
  for (auto &i : same_d) {
    for (auto &j : i) arr.emplace(j);
  }
  for (auto &d : arr) {
    long long int s = 0;
    for (auto i : a) s += ((i + d - 1) / d);
    long long int ad = k / s;
    if (d <= ad) ans = max(ans, ad);
  }
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  auto clk = clock();
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
  for (int i = 1; i < t + 1; i++) solve(i);
}
