#include <bits/stdc++.h>
using namespace std;
const int N = 110;
int a[N];
long long c[N * 40000 * 2];
int main() {
  int n;
  long long m;
  cin >> n >> m;
  int cnt = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    m += a[i];
    for (int j = 1; j * j <= a[i]; j++) {
      c[cnt++] = j;
      c[cnt++] = (a[i] + j - 1) / j;
    }
  }
  c[cnt] = 1LL << 60;
  sort(c, c + cnt);
  long long ans = 1;
  for (int i = 0; i < cnt; i++) {
    if (c[i] == c[i + 1]) continue;
    long long sum = 0;
    for (int j = 1; j <= n; j++) {
      sum += (a[j] + c[i] - 1) / c[i];
    }
    long long d = m / sum;
    if (d >= c[i] && d < c[i + 1]) ans = max(ans, d);
  }
  cout << ans << endl;
  return 0;
}
