#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10, oo = 1e9, M = 5e5;
long long const OO = 1e18;
int mod = oo + 7;
double const eps = 1e-4, PI = acos(-1);
long long k, kk, aa[101];
int n;
bool check(long long d) {
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += ((aa[i] + d - 1) / d) * d - aa[i];
    if (sum > kk) return 0;
  }
  return 1;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  kk = k;
  for (int i = 0; i < n; i++) {
    cin >> aa[i];
    k += aa[i];
  }
  long long mx = 0;
  for (long long i = 1; i * i <= k; i++) {
    if (check(i)) mx = max(i, mx);
    if (check(k / i)) mx = max(mx, k / i);
  }
  cout << mx;
  return 0;
}
