
def fun(X_high, X_low, K, line):
    X = (X_high + X_low) // 2
    cnt = 0
    for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
    if cnt > K:
        X_low = X
    else:
        X_high = X
    return X_high, X_low

N, K = map(int, input().split(" "))
line = list(map(int, input().split(" ")))

X_high = max(line)
X_low = 0

while (X_high - X_low) > 1:
    X_high, X_low = fun(X_high, X_low, K, line)
    
print(X_high) def fun(X_high, X_low, K, line):
    X = (X_high + X_low) // 2
    cnt = 0
    for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
    if cnt > K:
        X_low = X
    else:
        X_high = X
    return X_high, X_low fun X = (X_high + X_low) // 2 X (X_high + X_low) // 2 X_high + X_low X_high X_low 2 cnt = 0 cnt 0 for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
     tree line if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
     tree <= X tree X continue q, r = divmod(tree, X) q divmod(tree, X) divmod tree X r if r == 0:
                q -= 1
             r == 0 r 0 q -= 1 q 1 cnt += q cnt q if cnt > K:
        X_low = X
    else:
        X_high = X
     cnt > K cnt K X_low = X X_low X X_high = X X_high X return X_high, X_low return X_high, X_low X_high X_low X_high X_high X_low X_low K K line line N, K = map(int, input().split(" ")) N map(int, input().split(" ")) map int input().split(" ") ().split () input split " " K line = list(map(int, input().split(" "))) line list(map(int, input().split(" "))) list map(int, input().split(" ")) map int input().split(" ") ().split () input split " " X_high = max(line) X_high max(line) max line X_low = 0 X_low 0 while (X_high - X_low) > 1:
    X_high, X_low = fun(X_high, X_low, K, line)
     (X_high - X_low) > 1 X_high - X_low X_high X_low 1 X_high, X_low = fun(X_high, X_low, K, line) X_high fun(X_high, X_low, K, line) fun X_high X_low K line X_low print(X_high) print X_high K = map(int, input().split(" ")) map(int, input().split(" ")) K line = list(map(int, input().split(" "))) list(map(int, input().split(" "))) line def fun(X_high, X_low, K, line):
    X = (X_high + X_low) // 2
    cnt = 0
    for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
    if cnt > K:
        X_low = X
    else:
        X_high = X
    return X_high, X_low def fun(X_high, X_low, K, line):
    X = (X_high + X_low) // 2
    cnt = 0
    for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
    if cnt > K:
        X_low = X
    else:
        X_high = X
    return X_high, X_low fun X_low = 0 0 X_low N, K = map(int, input().split(" ")) map(int, input().split(" ")) N X_high = max(line) max(line) X_high X_high, X_low = fun(X_high, X_low, K, line) fun(X_high, X_low, K, line) X_high X_low = fun(X_high, X_low, K, line) fun(X_high, X_low, K, line) X_low

def fun(X_high, X_low, K, line):
    X = (X_high + X_low) // 2
    cnt = 0
    for tree in line:
        if tree <= X:
            continue
        else:
            q, r = divmod(tree, X)
            if r == 0:
                q -= 1
            cnt += q
    if cnt > K:
        X_low = X
    else:
        X_high = X
    return X_high, X_low

N, K = map(int, input().split(" "))
line = list(map(int, input().split(" ")))

X_high = max(line)
X_low = 0

while (X_high - X_low) > 1:
    X_high, X_low = fun(X_high, X_low, K, line)
    
print(X_high)