def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper

if __name__ == '__main__':
    print(abc174_e()) def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper abc174_e 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 if k == 0: return max(A)

     k == 0 k 0 lower, upper = 0, 10**9 lower 0 upper 10**9 10 9 while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
     upper - lower > 1 upper - lower upper lower 1 x = (upper + lower) // 2 x (upper + lower) // 2 upper + lower upper lower 2 cnt = 0 cnt 0 for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
         a A cnt += a // x cnt a // x a x if a % x == 0: cnt -= 1
             a % x == 0 a % x a x 0 if cnt > k: break
         cnt > k cnt k if cnt > k: lower = x
        else: upper = x
     cnt > k cnt k return upper upper if __name__ == '__main__':
    print(abc174_e()) __name__ == '__main__' __name__ '__main__' print(abc174_e()) print abc174_e() abc174_e def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper abc174_e
def abc174_e():
    n, k = map(int, input().split())
    A = list(map(int, input().split()))
    if k == 0: return max(A)

    lower, upper = 0, 10**9
    while upper - lower > 1:
        x = (upper + lower) // 2
        cnt = 0
        for a in A:
            cnt += a // x
            if a % x == 0: cnt -= 1
            if cnt > k: break
        if cnt > k: lower = x
        else: upper = x
    return upper

if __name__ == '__main__':
    print(abc174_e())