def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
    L, R = 0, max(arr)
    while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
    print(R)

if __name__ == "__main__":
    main() def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
    L, R = 0, max(arr)
    while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
    print(R) main n, k = map(int, input().split()) n map(int, input().split()) map int input().split() ().split () input split k arr = list(map(int, input().split())) arr list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split L, R = 0, max(arr) L 0 R max(arr) max arr while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
     L+1 < R L+1 L 1 R P = (L+R+1)//2 P (L+R+1)//2 L+R+1 L+R L R 1 2 cnt = 0 cnt 0 for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
         a arr if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
         P < a P a if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
         a % P == 0 a % P a P 0 cnt += a//P - 1 cnt a//P - 1 a//P a P 1 cnt += a//P cnt a//P a P if cnt <= k:
            R = P
        else:
            L = P
     cnt <= k cnt k R = P R P L = P L P print(R) print R if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
    L, R = 0, max(arr)
    while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
    print(R) def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
    L, R = 0, max(arr)
    while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
    print(R) main
def main():
    n, k = map(int, input().split())
    arr = list(map(int, input().split()))
    L, R = 0, max(arr)
    while L+1 < R:
        P = (L+R+1)//2
        cnt = 0
        for a in arr:
            if P < a:
                if a % P == 0:
                    cnt += a//P - 1
                else:
                    cnt += a//P
        if cnt <= k:
            R = P
        else:
            L = P
    print(R)

if __name__ == "__main__":
    main()
