def main():
    _, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    if K == 0:
        print(max(A))
        return

    def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

    def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search())


if __name__ == '__main__':
    main() def main():
    _, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    if K == 0:
        print(max(A))
        return

    def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

    def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search()) main int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i _, K = (int(i) for i in input().split()) _ (int(i) for i in input().split()) K int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i A = [int(i) for i in input().split()] A [int(i) for i in input().split()] if K == 0:
        print(max(A))
        return

     K == 0 K 0 print(max(A)) print max(A) max A return def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

     is_ok need = 0 need 0 for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
         a A if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
         a % x == 0 a % x a x 0 need += a//x - 1 need a//x - 1 a//x a x 1 need += a//x need a//x a x if need <= K:
            return True
        else:
            return False

     need <= K need K return True True return False False x x def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

     binary_search ng = 0 ng 0 ok = 10**9 ok 10**9 10 9 while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
         abs(ok - ng) > 1 abs(ok - ng) abs ok - ng ok ng 1 mid = ng + (ok - ng) // 2 mid ng + (ok - ng) // 2 ng (ok - ng) // 2 ok - ng ok ng 2 if is_ok(mid):
                ok = mid
            else:
                ng = mid
         is_ok(mid) is_ok mid ok = mid ok mid ng = mid ng mid return ok ok print(binary_search()) print binary_search() binary_search if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    _, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    if K == 0:
        print(max(A))
        return

    def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

    def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search()) def main():
    _, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    if K == 0:
        print(max(A))
        return

    def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

    def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search()) main
def main():
    _, K = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    if K == 0:
        print(max(A))
        return

    def is_ok(x):
        need = 0
        for a in A:
            if a % x == 0:
                need += a//x - 1
            else:
                need += a//x
        if need <= K:
            return True
        else:
            return False

    def binary_search():
        ng = 0
        ok = 10**9
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search())


if __name__ == '__main__':
    main()
