import math 

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

A=[int(x) for x in input().split()]

A=sorted(A)

left=0

right=max(A)

mid=max((left+right)//2,1)



while(right-left>=1):

    numofcut=0

    

    for i in range(N):

        if A[i]%mid==0:

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

        else:

            numofcut+=A[i]//mid

    #print(numofcut)

    if numofcut>K:

        left=mid+1

    else:

        right=mid

    mid=max((left+right)//2,1)

    if mid==1:

        break

print(mid)
import math 

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

A=[int(x) for x in input().split()]

A=sorted(A)

left=0

right=max(A)

mid=max((left+right)//2,1)



while(right-left>=1):

    numofcut=0

    

    for i in range(N):

        numofcut+=math.ceil(A[i]/mid)-1

    #print(numofcut)

    if numofcut>K:

        left=mid+1

    else:

        right=mid

    mid=max((left+right)//2,1)

    if mid==1:

        break

print(mid)
import math

N, K = list(map(int, input().split()))
A = [int(x) for x in input().split()]
A = sorted(A)
left = 0
right = max(A)
mid = max((left + right) // 2, 1)
while right - left >= 1:
    numofcut = 0
    for i in range(N):
        if A[i] % mid == 0:
            numofcut += (A[i] // mid) - 1
        else:
            numofcut += A[i] // mid
    # print(numofcut)
    if numofcut > K:
        left = mid + 1
    else:
        right = mid
    mid = max((left + right) // 2, 1)
    if mid == 1:
        break
print(mid)

import math

N, K = list(map(int, input().split()))
A = [int(x) for x in input().split()]
A = sorted(A)
left = 0
right = max(A)
mid = max((left + right) // 2, 1)
while right - left >= 1:
    numofcut = 0
    for i in range(N):
        numofcut += math.ceil(A[i] / mid) - 1
    # print(numofcut)
    if numofcut > K:
        left = mid + 1
    else:
        right = mid
    mid = max((left + right) // 2, 1)
    if mid == 1:
        break
print(mid)

-        if A[i] % mid == 0: -            numofcut += (A[i] // mid) - 1 -        else: -            numofcut += A[i] // mid +        numofcut += math.ceil(A[i] / mid) - 1