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

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



left = 1

right= max(A)



import math



dict_X = {}

while True:

  

  cl = 0

  for i in range(N):

    cl += math.ceil(A[i]/left) - 1

  cr = 0

  for i in range(N):

    cr += math.ceil(A[i]/right) - 1

  

  mid = (left + right)//2

  cm = 0

  for i in range(N):

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

  if(cl<=K):

    right = left

    break

  elif(cm<=K):

    right = mid

  else:

    left = mid

  

  if(left>=right-1):

    break

    

print(right)

 

  

    

    

























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

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



left = 1

right= max(A)



import math



while True:

  

  cl = 0

  for i in range(N):

    cl += math.ceil(A[i]/left) - 1

  

  mid = (left + right)//2

  cm = 0

  for i in range(N):

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

  if(cl<=K):

    right = left

    break

  if(cm<=K):

    right = mid

  else:

    left = mid

  if(abs(left-right)<=1):

    break



print(right)

  

 

  

    

    

























N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 1
right = max(A)
import math

dict_X = {}
while True:
    cl = 0
    for i in range(N):
        cl += math.ceil(A[i] / left) - 1
    cr = 0
    for i in range(N):
        cr += math.ceil(A[i] / right) - 1
    mid = (left + right) // 2
    cm = 0
    for i in range(N):
        cm += math.ceil(A[i] / mid) - 1
    if cl <= K:
        right = left
        break
    elif cm <= K:
        right = mid
    else:
        left = mid
    if left >= right - 1:
        break
print(right)

N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
left = 1
right = max(A)
import math

while True:
    cl = 0
    for i in range(N):
        cl += math.ceil(A[i] / left) - 1
    mid = (left + right) // 2
    cm = 0
    for i in range(N):
        cm += math.ceil(A[i] / mid) - 1
    if cl <= K:
        right = left
        break
    if cm <= K:
        right = mid
    else:
        left = mid
    if abs(left - right) <= 1:
        break
print(right)

-dict_X = {} -    cr = 0 -    for i in range(N): -        cr += math.ceil(A[i] / right) - 1 -    elif cm <= K: +    if cm <= K: -    if left >= right - 1: +    if abs(left - right) <= 1: