#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 30, Mod = 1e9 + 7;
const long long SQ = 330;
long long n, k, a[N], ans;
set<long long> val;
long long c(long long x, long long y) { return ((x + y - 1) / y); }
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i], k += a[i];
  for (int i = 0; i < n; i++)
    for (int j = 1; j * j <= a[i]; j++) val.insert(j), val.insert(c(a[i], j));
  for (auto l : val) {
    long long res = 0;
    for (int i = 0; i < n; i++) res += c(a[i], l);
    long long d = k / res;
    if (d < l) continue;
    ans = max(ans, d);
  }
  cout << ans;
  return (0);
}
