import sys


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 =0
        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 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 =0
        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 =0
        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 =0 ans 0 for i in range(N):
            ans += A[i]//mid -1
            if A[i]%mid !=0:
                ans +=1

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

         A[i]%mid !=0 A[i]%mid A[i] A i mid 0 ans +=1 ans 1 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 =0
        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 =0
        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


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 =0
        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()
