import math

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

r = max(As)

if K == 0:
  print(r)
  exit()
  
l = 1

while l < r:
  mid = (r + l)//2
  cnt = 0
  for a in As:
    cnt += math.ceil(a/mid) - 1
  if cnt <= K:
    r = mid
  else:
    l = mid + 1
  
print(r) import math math N, K = map(int, input().split()) N map(int, input().split()) map int input().split() ().split () input split K As = list(map(int, input().split())) As list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split r = max(As) r max(As) max As if K == 0:
  print(r)
  exit()
   K == 0 K 0 print(r) print r exit() exit l = 1 l 1 while l < r:
  mid = (r + l)//2
  cnt = 0
  for a in As:
    cnt += math.ceil(a/mid) - 1
  if cnt <= K:
    r = mid
  else:
    l = mid + 1
   l < r l r mid = (r + l)//2 mid (r + l)//2 r + l r l 2 cnt = 0 cnt 0 for a in As:
    cnt += math.ceil(a/mid) - 1
   a As cnt += math.ceil(a/mid) - 1 cnt math.ceil(a/mid) - 1 math.ceil(a/mid) math.ceil math ceil a/mid a mid 1 if cnt <= K:
    r = mid
  else:
    l = mid + 1
   cnt <= K cnt K r = mid r mid l = mid + 1 l mid + 1 mid 1 print(r) print r cnt += math.ceil(a/mid) - 1 math.ceil(a/mid) - 1 cnt N, K = map(int, input().split()) map(int, input().split()) N r = max(As) max(As) r r = mid mid r cnt = 0 0 cnt l = mid + 1 mid + 1 l mid = (r + l)//2 (r + l)//2 mid K = map(int, input().split()) map(int, input().split()) K As = list(map(int, input().split())) list(map(int, input().split())) As l = 1 1 l
import math

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

r = max(As)

if K == 0:
  print(r)
  exit()
  
l = 1

while l < r:
  mid = (r + l)//2
  cnt = 0
  for a in As:
    cnt += math.ceil(a/mid) - 1
  if cnt <= K:
    r = mid
  else:
    l = mid + 1
  
print(r)