#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int A[1000];
int main() {
  ios_base::sync_with_stdio(0);
  long long N, K;
  cin >> N >> K;
  long long sum = 0;
  for (int i = 0; i < (N); ++i) {
    cin >> A[i];
    sum += A[i];
  }
  vector<long long> tested;
  for (int i = 0; i < (N); ++i) {
    for (int j = (1); j < (35000); ++j) {
      tested.push_back(A[i] / j);
      tested.push_back(A[i] / j + 1);
      if (A[i] / j > 0) tested.push_back(A[i] / j - 1);
    }
  }
  for (int i = (1); i < (35000); ++i) tested.push_back(i);
  tested.push_back(0);
  tested.push_back(1e13);
  sort(tested.begin(), tested.end());
  tested.erase(unique(tested.begin(), tested.end()), tested.end());
  int L = tested.size();
  long long result = 1;
  for (int j = (L - 1) - 1; j >= (0); --j) {
    long long B = tested[j + 1];
    int Ax = tested[j] + 1;
    long long removals = 0;
    for (int i = 0; i < (N); ++i) {
      removals += A[i] / Ax;
      if (A[i] / Ax * Ax != A[i]) ++removals;
    }
    long long maxD = (K + sum) / removals;
    if (maxD >= Ax) result = max(result, min(maxD, B));
  }
  cout << result << endl;
}
