#include #include #include using namespace std; using namespace atcoder; #define rep(i, l, n) for (int i = (l); i < (n); i++) #define ite(i, a) for(auto& i : a) #define all(x) x.begin(), x.end() #define lb lower_bound #define ub upper_bound #define lbi(A, x) (ll)(lb(all(A), x) - A.begin()) #define ubi(A, x) (ll)(ub(all(A), x) - A.begin()) using ll = long long; using Pair = pair; template using V = vector; template using VV = V >; const ll INF = 1000000000000000001; const int inf = 1001001001; const ll mod = 1000000007; const ll MOD = 998244353; template inline V getList(int n) { V res(n); rep(i, 0, n) { cin >> res[i]; }return res; } template inline VV getGrid(int m, int n) { VV res(m, V(n)); rep(i, 0, m) { res[i] = getList(n); }return res; } inline V dtois(string& s) { V vec = {}; for (auto& e : s) { vec.push_back(e - '0'); } return vec; } int main(void) { int n, m; cin >> n >> m; V a = getList(n); ll s = 0, ans = INF; rep(i, 0, n) { s += a[i]; ans = min(ans, s / m / (i + 1)); } cout << ans << endl; return 0; }