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

    def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

    def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
    sum_A = sum(A)
    max_ans = (sum_A + K)//(K+1)
    min_ans = (sum_A + K+N-1)//(K+N)
    ans = binary_search(min_ans-1, max_ans)
    print(ans)
if __name__ == "__main__":
    main() def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

    def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
    sum_A = sum(A)
    max_ans = (sum_A + K)//(K+1)
    min_ans = (sum_A + K+N-1)//(K+N)
    ans = binary_search(min_ans-1, max_ans)
    print(ans) 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 def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

     isOK count = sum((a-1)//x for a in A) count sum((a-1)//x for a in A) sum (a-1)//x a-1 a 1 x if count <= K:
            return True
        else:
            return False

     count <= K count K return True True return False False x x def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
     binary_search """(l, r]""" left = init_l left init_l right = init_r right init_r while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

         right-left > 1 right-left right left 1 mid = (right+left)//2 mid (right+left)//2 right+left right left 2 if isOK(mid):
                right = mid
            else:
                left = mid

         isOK(mid) isOK mid right = mid right mid left = mid left mid return right right init_l init_l init_r init_r sum_A = sum(A) sum_A sum(A) sum A max_ans = (sum_A + K)//(K+1) max_ans (sum_A + K)//(K+1) sum_A + K sum_A K K+1 K 1 min_ans = (sum_A + K+N-1)//(K+N) min_ans (sum_A + K+N-1)//(K+N) sum_A + K+N-1 sum_A + K+N sum_A + K sum_A K N 1 K+N K N ans = binary_search(min_ans-1, max_ans) ans binary_search(min_ans-1, max_ans) binary_search min_ans-1 min_ans 1 max_ans print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

    def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
    sum_A = sum(A)
    max_ans = (sum_A + K)//(K+1)
    min_ans = (sum_A + K+N-1)//(K+N)
    ans = binary_search(min_ans-1, max_ans)
    print(ans) def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

    def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
    sum_A = sum(A)
    max_ans = (sum_A + K)//(K+1)
    min_ans = (sum_A + K+N-1)//(K+N)
    ans = binary_search(min_ans-1, max_ans)
    print(ans) main
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    def isOK(x):
        count = sum((a-1)//x for a in A)
        if count <= K:
            return True
        else:
            return False

    def binary_search(init_l, init_r):
        """(l, r]"""
        left = init_l
        right = init_r

        while right-left > 1:
            mid = (right+left)//2
            if isOK(mid):
                right = mid
            else:
                left = mid

        return right
    
    sum_A = sum(A)
    max_ans = (sum_A + K)//(K+1)
    min_ans = (sum_A + K+N-1)//(K+N)
    ans = binary_search(min_ans-1, max_ans)
    print(ans)
if __name__ == "__main__":
    main()