#include <bits/stdc++.h>
using namespace std;
set<int> pos;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  long long k;
  cin >> n >> k;
  int arr[n + 1];
  long long sum = 0;
  pos.insert(1);
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    sum += arr[i];
    int x = sqrt(arr[i]);
    for (int j = 1; j <= x; j++) {
      pos.insert(j);
      int val = arr[i] / j;
      if (arr[i] % j) val++;
      pos.insert(val);
    }
  }
  k += sum;
  long long ans = 1;
  for (auto it : pos) {
    long long val = 0;
    for (int i = 1; i <= n; i++) {
      int u = arr[i] / it;
      if (arr[i] % it) u++;
      val += u;
    }
    long long u = k / val;
    if (it <= u) ans = (ans > u ? ans : u);
  }
  cout << ans;
}
