#include <bits/stdc++.h>   using namespace std;   const int maxn = 105;   int a[maxn];   long long n, k;   bool ok(long long d) {     long long ret = 0;     for (int i = 0; i < n; ++i) {       ret += (a[i] - 1 + d) / d;     }     return ret * d <= k;   }   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cin >> n >> k;     for (int i = 0; i < n; ++i) cin >> a[i], k += a[i];     long long ans = 0;     for (long long i = 1; i <= sqrt(k) + 1; ++i) {       if (ok(i)) ans = max(ans, i);       if (ok(k / i)) ans = max(ans, k / i);     }     cout << ans << endl;     return 0;   }   