import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
X = max(A)
if K == 0:
    print(X)
    exit()
else:
    for i in range(1, math.ceil(math.log2(X)) + 5):
        B = []
        for a in A:
            b = math.ceil(a / X) - 1
            B.append(b)
        B_total = sum(B)
        if B_total > K:
            X += max(A) / pow(2, i)
        else:
            X -= max(A) / pow(2, i)
    print(math.ceil(X)) import math math N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K A = list(map(int, input().split())) A list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split X = max(A) X max(A) max A if K == 0:
    print(X)
    exit()
else:
    for i in range(1, math.ceil(math.log2(X)) + 5):
        B = []
        for a in A:
            b = math.ceil(a / X) - 1
            B.append(b)
        B_total = sum(B)
        if B_total > K:
            X += max(A) / pow(2, i)
        else:
            X -= max(A) / pow(2, i)
    print(math.ceil(X)) K == 0 K 0 print(X) print X exit() exit for i in range(1, math.ceil(math.log2(X)) + 5):
        B = []
        for a in A:
            b = math.ceil(a / X) - 1
            B.append(b)
        B_total = sum(B)
        if B_total > K:
            X += max(A) / pow(2, i)
        else:
            X -= max(A) / pow(2, i)
     i range(1, math.ceil(math.log2(X)) + 5) range 1 math.ceil(math.log2(X)) + 5 math.ceil(math.log2(X)) math.ceil math ceil math.log2(X) math.log2 math log2 X 5 B = [] B [] for a in A:
            b = math.ceil(a / X) - 1
            B.append(b)
         a A b = math.ceil(a / X) - 1 b math.ceil(a / X) - 1 math.ceil(a / X) math.ceil math ceil a / X a X 1 B.append(b) B.append B append b B_total = sum(B) B_total sum(B) sum B if B_total > K:
            X += max(A) / pow(2, i)
        else:
            X -= max(A) / pow(2, i)
     B_total > K B_total K X += max(A) / pow(2, i) X max(A) / pow(2, i) max(A) max A pow(2, i) pow 2 i X -= max(A) / pow(2, i) X max(A) / pow(2, i) max(A) max A pow(2, i) pow 2 i print(math.ceil(X)) print math.ceil(X) math.ceil math ceil X N, K = map(int, input().split()) map(int, input().split()) N X = max(A) max(A) X A = list(map(int, input().split())) list(map(int, input().split())) A K = map(int, input().split()) map(int, input().split()) K B = [] [] B b = math.ceil(a / X) - 1 math.ceil(a / X) - 1 b X += max(A) / pow(2, i) max(A) / pow(2, i) X X -= max(A) / pow(2, i) max(A) / pow(2, i) X B_total = sum(B) sum(B) B_total
import math
N, K = map(int, input().split())
A = list(map(int, input().split()))
X = max(A)
if K == 0:
    print(X)
    exit()
else:
    for i in range(1, math.ceil(math.log2(X)) + 5):
        B = []
        for a in A:
            b = math.ceil(a / X) - 1
            B.append(b)
        B_total = sum(B)
        if B_total > K:
            X += max(A) / pow(2, i)
        else:
            X -= max(A) / pow(2, i)
    print(math.ceil(X))