from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))
from functools import reduce

def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r)

if __name__ == '__main__':
    main() from sys import stdin rs = stdin.readline rs stdin.readline stdin readline ri = lambda : int(rs()) ri lambda : int(rs()) int(rs()) int rs() rs ril = lambda : list(map(int, rs().split())) ril lambda : list(map(int, rs().split())) list(map(int, rs().split())) list map(int, rs().split()) map int rs().split() ().split () rs split from functools import reduce def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r) main N, K = ril() N ril() ril K A = ril() A ril() ril l = 1 l 1 r = 1000000000 r 1000000000 while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
     l < r l r m = (l + r) // 2 m (l + r) // 2 l + r l r 2 f = lambda i, j : i + (j - 1) // m f lambda i, j : i + (j - 1) // m i + (j - 1) // m i (j - 1) // m j - 1 j 1 m i j k = reduce(f, A, 0) k reduce(f, A, 0) reduce f A 0 if k <= K:
            r = m
        else:
            l = m + 1
     k <= K k K r = m r m l = m + 1 l m + 1 m 1 print(r) print r if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main ri = lambda : int(rs()) lambda : int(rs()) ri def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r) def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r) main rs = stdin.readline stdin.readline rs ril = lambda : list(map(int, rs().split())) lambda : list(map(int, rs().split())) ril
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))
from functools import reduce

def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r)

if __name__ == '__main__':
    main()
