def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
    return True

n, k = map(int, input().split())
A = list(map(int, input().split()))
l = 0
r = max(A)
while r - l != 1:
    x = (r + l) // 2
    if judge(A, x, k):
        r = x
    else:
        l = x
print(r) def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
    return True judge ans = 0 ans 0 for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
     a A ans += a // x ans a // x a x if a % x == 0:
            ans -= 1
         a % x == 0 a % x a x 0 ans -= 1 ans 1 if ans > k:
            return False
     ans > k ans k return False False return True True A A x x k k 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 l = 0 l 0 r = max(A) r max(A) max A while r - l != 1:
    x = (r + l) // 2
    if judge(A, x, k):
        r = x
    else:
        l = x r - l != 1 r - l r l 1 x = (r + l) // 2 x (r + l) // 2 r + l r l 2 if judge(A, x, k):
        r = x
    else:
        l = x judge(A, x, k) judge A x k r = x r x l = x l x print(r) print r r = max(A) max(A) r r = x x r n, k = map(int, input().split()) map(int, input().split()) n x = (r + l) // 2 (r + l) // 2 x A = list(map(int, input().split())) list(map(int, input().split())) A l = x x l l = 0 0 l def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
    return True def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
    return True judge k = map(int, input().split()) map(int, input().split()) k
def judge(A, x, k):
    ans = 0
    for a in A:
        ans += a // x
        if a % x == 0:
            ans -= 1
        if ans > k:
            return False
    return True

n, k = map(int, input().split())
A = list(map(int, input().split()))
l = 0
r = max(A)
while r - l != 1:
    x = (r + l) // 2
    if judge(A, x, k):
        r = x
    else:
        l = x
print(r)