#include using namespace std; void fast_io() { ios::sync_with_stdio(false); std::cin.tie(nullptr); } int main() { fast_io(); int n, m; cin >> n >> m; long long ans = 9e18; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } for (int i = 0; i <= n - 2; i++) { a[i + 1] += a[i]; } for (int i = 0; i < n; i++) { ans = min(ans, a[i] / ((long long)(i + 1) * m)); } cout << ans << endl; }