#include <bits/stdc++.h>
using namespace std;
int n, A[105];
long long k, ans;
int main() {
  scanf("%d %I64d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &A[i]);
  }
  for (int d = 1; d <= 100010; d++) {
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      long long qi = (A[i] + d - 1) / d;
      sum += qi * (long long)d - A[i];
    }
    if (sum <= k) ans = d;
  }
  vector<long long> dlist;
  for (int i = 1; i <= n; i++) {
    for (int qi = 1; qi <= 10010; qi++) {
      long long L = 1, R = 1e15;
      long long x = -1;
      while (L <= R) {
        long long mid = (L + R) / 2;
        if ((A[i] + mid - 1) / mid >= qi) {
          x = mid, L = mid + 1;
        } else
          R = mid - 1;
      }
      if (x != -1) dlist.push_back(x);
    }
  }
  dlist.push_back(1);
  dlist.push_back(1e15);
  sort(dlist.begin(), dlist.end());
  dlist.erase(unique(dlist.begin(), dlist.end()), dlist.end());
  for (int i = 0; i < (int)dlist.size() - 1; i++) {
    long long d = dlist[i] + 1;
    long long qsum = 0;
    long long sum = 0;
    for (int i = 1; i <= n; i++) {
      long long q = (long long)(A[i] + d - 1) / d;
      sum += q * d - A[i];
      qsum += q;
    }
    long long L = d, R = dlist[i + 1];
    long long ret = -1;
    while (L <= R) {
      long long mid = (L + R) / 2;
      if (sum + (mid - d) * qsum <= k) {
        ret = mid, L = mid + 1;
      } else
        R = mid - 1;
    }
    ans = max(ans, ret);
  }
  printf("%I64d", ans);
}
