from bisect import bisect_right

from math import ceil

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

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

if K==0:

    print((max(A)))

    exit()



A=sorted(A)

# 最小値で二分探索 してまだ行けるかどうか

# 回数で二分探索

left=0

right=max(A)



ans=float("INF")

pre=ans

flag=False

count=0

while True:

    now=0

    mid=(left+right)/2

    idx=bisect_right(A, mid)

    for i in range(idx, N):

        now+=ceil(A[i]/mid)-1

    if now==K:

        if ans!=float("INF"):

            if ans==ceil(mid):

                flag=True

        ans=min(ans, ceil(mid))

        right=mid

        

        #if flag:

        #    break

        pre=ans

    if now>K:

        left=mid

        pre=mid

    if now<K:

        ans=min(ans, ceil(mid))

        right=mid

        pre=mid

    count+=1

    if count>=10**2:

        break

    





if ans==float("INF"):

    ans=max(A)

print((ceil(ans)))
from math import ceil

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



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



left=1

right=10**9+1

ans=float("INF")

while True:

    mid=(left+right)//2

    now=0

    for i in range(N):

        now+=ceil(A[i]/mid)-1



    if now>K:

        if left==mid:

            break

        left=mid

    else:

        ans=min(ans, mid)

        if right==mid:

            break

        right=mid



print(ans)
from bisect import bisect_right
from math import ceil

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
if K == 0:
    print((max(A)))
    exit()
A = sorted(A)
# 最小値で二分探索 してまだ行けるかどうか
# 回数で二分探索
left = 0
right = max(A)
ans = float("INF")
pre = ans
flag = False
count = 0
while True:
    now = 0
    mid = (left + right) / 2
    idx = bisect_right(A, mid)
    for i in range(idx, N):
        now += ceil(A[i] / mid) - 1
    if now == K:
        if ans != float("INF"):
            if ans == ceil(mid):
                flag = True
        ans = min(ans, ceil(mid))
        right = mid
        # if flag:
        #    break
        pre = ans
    if now > K:
        left = mid
        pre = mid
    if now < K:
        ans = min(ans, ceil(mid))
        right = mid
        pre = mid
    count += 1
    if count >= 10**2:
        break
if ans == float("INF"):
    ans = max(A)
print((ceil(ans)))

from math import ceil

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 1
right = 10**9 + 1
ans = float("INF")
while True:
    mid = (left + right) // 2
    now = 0
    for i in range(N):
        now += ceil(A[i] / mid) - 1
    if now > K:
        if left == mid:
            break
        left = mid
    else:
        ans = min(ans, mid)
        if right == mid:
            break
        right = mid
print(ans)

-from bisect import bisect_right -if K == 0: -    print((max(A))) -    exit() -A = sorted(A) -# 最小値で二分探索 してまだ行けるかどうか -# 回数で二分探索 -left = 0 -right = max(A) +left = 1 +right = 10**9 + 1 -pre = ans -flag = False -count = 0 +    mid = (left + right) // 2 -    mid = (left + right) / 2 -    idx = bisect_right(A, mid) -    for i in range(idx, N): +    for i in range(N): -    if now == K: -        if ans != float("INF"): -            if ans == ceil(mid): -                flag = True -        ans = min(ans, ceil(mid)) +    if now > K: +        if left == mid: +            break +        left = mid +    else: +        ans = min(ans, mid) +        if right == mid: +            break -        # if flag: -        #    break -        pre = ans -    if now > K: -        left = mid -        pre = mid -    if now < K: -        ans = min(ans, ceil(mid)) -        right = mid -        pre = mid -    count += 1 -    if count >= 10**2: -        break -if ans == float("INF"): -    ans = max(A) -print((ceil(ans))) +print(ans)