import math def judge(mid): cnt = 0 nokori = k for i in range(n): if mid > a[i] + cnt: # print(cnt,(mid - a[i] - cnt)) nokori -= math.ceil((mid - a[i] - cnt) / (i + 1)) cnt += (i + 1) * math.ceil((mid - a[i] - cnt) / (i + 1)) if nokori < 0: return False else: return True n, k = map(int, input().split()) a = list(map(int, input().split())) ok = 0 ng = 10 ** 18 while abs(ok - ng) > 1: mid = (ok + ng) // 2 if judge(mid): ok = mid else: ng = mid print(ok)