import itertools n,m = map(int,input().split()) a = list(map(int,input().split())) s = list(itertools.accumulate(a)) if(len(a) != n): exit() if not(1 <= n <= 2*(10**5) and 1 <= m <= 10**9): exit() if not(all(0 <= i <= 10**9 for i in a)): exit() def func(k): t = m * k res = True for i in s: if(i < t): res = False break t += m * k return res ok = 0 ng = 10**9+1 while(ng-ok > 1): k = (ok+ng)//2 if(func(k)): ok = k else: ng = k print(ok)