#include <bits/stdc++.h>
using namespace std;
const long long M = 1e3 + 44;
long long k;
long long n;
long long num[M];
bool check(long long d) {
  long long tmp = 0;
  for (long long i = 1; i <= n; i++) tmp += (num[i] + d - 1) / d * d;
  if (tmp <= k)
    return true;
  else
    return false;
}
void solve() {
  long long i, j, ans = 1;
  for (i = 1; i * i <= k; i++) {
    if (check(i)) ans = max(ans, i);
    if (check(k / i)) ans = max(ans, k / i);
  }
  cout << ans << endl;
}
int main() {
  long long i, j;
  cin >> n >> k;
  for (i = 1; i <= n; i++) {
    cin >> num[i];
    k += num[i];
  }
  solve();
  return 0;
}
