import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k = nm()
    a = nl()
    ng = 0
    ok = max(a) + 1
    while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
    print(ok)
    return

solve() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline readall = sys.stdin.read readall sys.stdin.read sys.stdin sys stdin read ns = lambda: readline().rstrip() ns lambda: readline().rstrip() readline().rstrip() ().rstrip () readline rstrip ni = lambda: int(readline().rstrip()) ni lambda: int(readline().rstrip()) int(readline().rstrip()) int readline().rstrip() ().rstrip () readline rstrip nm = lambda: map(int, readline().split()) nm lambda: map(int, readline().split()) map(int, readline().split()) map int readline().split() ().split () readline split nl = lambda: list(map(int, readline().split())) nl lambda: list(map(int, readline().split())) list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split prn = lambda x: print(*x, sep='\n') prn lambda x: print(*x, sep='\n') print(*x, sep='\n') print *x x sep='\n' sep '\n' x def solve():
    n, k = nm()
    a = nl()
    ng = 0
    ok = max(a) + 1
    while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
    print(ok)
    return solve n, k = nm() n nm() nm k a = nl() a nl() nl ng = 0 ng 0 ok = max(a) + 1 ok max(a) + 1 max(a) max a 1 while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
     ok - ng > 1 ok - ng ok ng 1 mid = (ok + ng) // 2 mid (ok + ng) // 2 ok + ng ok ng 2 cnt = 0 cnt 0 for x in a:
            cnt += (x - 1)//mid
         x a cnt += (x - 1)//mid cnt (x - 1)//mid x - 1 x 1 mid if cnt > k:
            ng = mid
        else:
            ok = mid
     cnt > k cnt k ng = mid ng mid ok = mid ok mid print(ok) print ok return solve() solve ns = lambda: readline().rstrip() lambda: readline().rstrip() ns readline = sys.stdin.readline sys.stdin.readline readline readall = sys.stdin.read sys.stdin.read readall nm = lambda: map(int, readline().split()) lambda: map(int, readline().split()) nm nl = lambda: list(map(int, readline().split())) lambda: list(map(int, readline().split())) nl def solve():
    n, k = nm()
    a = nl()
    ng = 0
    ok = max(a) + 1
    while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
    print(ok)
    return def solve():
    n, k = nm()
    a = nl()
    ng = 0
    ok = max(a) + 1
    while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
    print(ok)
    return solve ni = lambda: int(readline().rstrip()) lambda: int(readline().rstrip()) ni prn = lambda x: print(*x, sep='\n') lambda x: print(*x, sep='\n') prn
import sys

readline = sys.stdin.readline
readall = sys.stdin.read
ns = lambda: readline().rstrip()
ni = lambda: int(readline().rstrip())
nm = lambda: map(int, readline().split())
nl = lambda: list(map(int, readline().split()))
prn = lambda x: print(*x, sep='\n')

def solve():
    n, k = nm()
    a = nl()
    ng = 0
    ok = max(a) + 1
    while ok - ng > 1:
        mid = (ok + ng) // 2
        cnt = 0
        for x in a:
            cnt += (x - 1)//mid
        if cnt > k:
            ng = mid
        else:
            ok = mid
    print(ok)
    return

solve()
