#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
int a[100010];
long long n, k;
bool check(long long d) {
  long long res = 0;
  for (int i = 0; i < n; i++) res += (a[i] + d - 1) / d;
  return res * d <= k;
}
int main() {
  scanf("%I64d%I64d", &n, &k);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    k += a[i];
  }
  long long ans = 0;
  for (long long i = 1; i <= sqrt(k) + 1; i++) {
    if (check(i)) ans = max(ans, i);
    if (check(k / i)) ans = max(ans, k / i);
  }
  printf("%I64d\n", ans);
  return 0;
}
