N,K = map(int, input().split()) A = list(map(int, input().split())) su = 0 ma = 10**10 for i in range(N): su+=A[i] ma = min(su//(i+1),ma) print(ma//K)