#include #include #define rep(i, l, n) for (int i = (l); i < (n); i++) 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 = 0; rep(i, 0, n) { s += a[i]; } ll ans = 0; ll t = 0; ll flag = true; if (s / n >= 500000000) { ans = 1000000000; while(true) { s = t = 0; flag = true; rep(j, 0, n) { s += a[j]; t += m * ans; if (s < t) { flag = false; break; } } if (flag) { break; } ans--; } } else { while (true) { flag = false; s = t = 0; rep(i, 0, n) { s += a[i]; t += m * ans; if (s < t) { flag = true; break; } } if (flag) { ans--; break; } ans++; } } cout << ans << endl; return 0; }