#include <bits/stdc++.h>
using namespace std;
int n;
long long k, S;
int A[110];
bool valid(long long d) {
  long long C = 0LL;
  for (int i = 0; i < n; i++) C += (A[i] + d - 1) / d;
  C *= d;
  return C <= S + k;
}
int main() {
  scanf("%d %lld", &n, &k);
  S = 0LL;
  for (int i = 0; i < n; i++) {
    scanf("%d", &A[i]);
    S += A[i];
  }
  long long sq = (long long)sqrt(S + k);
  long long d = 0LL;
  for (long long i = 1; i <= sq; i++) {
    if (valid(i)) d = max(d, i);
    if (valid((S + k) / i)) d = max(d, (S + k) / i);
  }
  printf("%lld\n", d);
  return 0;
}
