#include #include #define rep(i, l, n) for (int i = (l); i < (n); i++) #define min(a,b) (((a) < (b)) ? (a) : (b)) using namespace std; using ll = long long; template using V = vector; int main(void) { ll n, m; cin >> n >> m; V a(n); rep(i, 0, n) { cin >> a[i]; } ll s = a[0]; ll ans = a[0] / m; rep(i, 1, n) { s += a[i]; ans = min(ans, s / (m * (i + 1))); } cout << ans << endl; return 0; }