import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ng = 0
    ok = 10 ** 9 + 1

    while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

    print(ok)


if __name__ == "__main__":
    main() import sys sys import math math def input():
    return sys.stdin.readline().rstrip() input return sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ng = 0
    ok = 10 ** 9 + 1

    while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

    print(ok) main 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 ng = 0 ng 0 ok = 10 ** 9 + 1 ok 10 ** 9 + 1 10 ** 9 10 9 1 while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

     ok - ng > 1 ok - ng ok ng 1 mid = (ok + ng) // 2 mid (ok + ng) // 2 ok + ng ok ng 2 ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A))) ans sum(list(map(lambda x: math.ceil(x / mid) - 1, A))) sum list(map(lambda x: math.ceil(x / mid) - 1, A)) list map(lambda x: math.ceil(x / mid) - 1, A) map lambda x: math.ceil(x / mid) - 1 math.ceil(x / mid) - 1 math.ceil(x / mid) math.ceil math ceil x / mid x mid 1 x A if ans <= K:
            ok = mid
        else:
            ng = mid

     ans <= K ans K ok = mid ok mid ng = mid ng mid print(ok) print ok if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ng = 0
    ok = 10 ** 9 + 1

    while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

    print(ok) def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ng = 0
    ok = 10 ** 9 + 1

    while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

    print(ok) main
import sys
import math


def input():
    return sys.stdin.readline().rstrip()


def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    ng = 0
    ok = 10 ** 9 + 1

    while ok - ng > 1:
        mid = (ok + ng) // 2
        ans = sum(list(map(lambda x: math.ceil(x / mid) - 1, A)))

        # for i in range(N):
        #     ans += A[i]//mid -1
        #     if A[i]%mid !=0:
        #         ans +=1

        if ans <= K:
            ok = mid
        else:
            ng = mid

    print(ok)


if __name__ == "__main__":
    main()
