from math import ceil

N,K = list(map(int,input().split()))

A=list(map(int,input().split()))





low=0

high=10**9+1



while low<=high:

    mid=(low+high)//2

    if mid==0:

        print((1))

        exit()



    cnt=0

    for a in A:

        if a<=mid:

            continue

        v=ceil(a/mid)

        cnt+=v-1



    if cnt<=K:

        high=mid-1

    else:

        low=mid+1

print(low)

from math import ceil

N,K = list(map(int,input().split()))

A=list(map(int,input().split()))





low=0

high=10**9+1



while low<=high:

    mid=(low+high)//2

    if mid==0: #0-div errorを消す

        print((1))

        exit()



    cnt=0

    for a in A:

        v=ceil(a/mid)

        cnt+=v-1



    if cnt<=K:

        high=mid-1

    else:

        low=mid+1

print(low)

from math import ceil

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
low = 0
high = 10**9 + 1
while low <= high:
    mid = (low + high) // 2
    if mid == 0:
        print((1))
        exit()
    cnt = 0
    for a in A:
        if a <= mid:
            continue
        v = ceil(a / mid)
        cnt += v - 1
    if cnt <= K:
        high = mid - 1
    else:
        low = mid + 1
print(low)

from math import ceil

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
low = 0
high = 10**9 + 1
while low <= high:
    mid = (low + high) // 2
    if mid == 0:  # 0-div errorを消す
        print((1))
        exit()
    cnt = 0
    for a in A:
        v = ceil(a / mid)
        cnt += v - 1
    if cnt <= K:
        high = mid - 1
    else:
        low = mid + 1
print(low)

-    if mid == 0: +    if mid == 0:  # 0-div errorを消す -        if a <= mid: -            continue