#include <bits/stdc++.h>
using namespace std;
long long int n, k;
long long int a[105];
bool check(long long int x) {
  long long int ans = 0;
  for (int i = 1; i <= n; i++) ans += ((a[i] - 1) / x + 1) * x - a[i];
  return ans <= k;
}
int main() {
  cin >> n >> k;
  long long int sum = k;
  long long int ans = 0;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  for (long long int i = 1; i * i <= sum; i++) {
    if (check(i)) ans = max(ans, i);
    if (check(sum / i)) ans = max(ans, sum / i);
  }
  cout << ans << endl;
  return 0;
}
