import math

n, k = map(int,input().split())
list = [int(x) for x in input().split()]
list.sort()

l = 0
r = max(list)

while r - l > 1:
  count = 0
  x = (r + l)//2

  for i in range(len(list)):
    if x >= list[i]:
      continue
    count += math.ceil(list[i]/x) - 1

  if count <= k:
    r = x
  else:
    l = x

print(r)
 import math math n, k = map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x list = [int(x) for x in input().split()] list [int(x) for x in input().split()] list.sort() list.sort list sort l = 0 l 0 r = max(list) r max(list) max list while r - l > 1:
  count = 0
  x = (r + l)//2

  for i in range(len(list)):
    if x >= list[i]:
      continue
    count += math.ceil(list[i]/x) - 1

  if count <= k:
    r = x
  else:
    l = x r - l > 1 r - l r l 1 count = 0 count 0 x = (r + l)//2 x (r + l)//2 r + l r l 2 for i in range(len(list)):
    if x >= list[i]:
      continue
    count += math.ceil(list[i]/x) - 1

   i range(len(list)) range len(list) len list if x >= list[i]:
      continue
     x >= list[i] x list[i] list i continue count += math.ceil(list[i]/x) - 1 count math.ceil(list[i]/x) - 1 math.ceil(list[i]/x) math.ceil math ceil list[i]/x list[i] list i x 1 if count <= k:
    r = x
  else:
    l = x count <= k count k r = x r x l = x l x print(r) print r l = 0 0 l x = (r + l)//2 (r + l)//2 x l = x x l count = 0 0 count count += math.ceil(list[i]/x) - 1 math.ceil(list[i]/x) - 1 count n, k = map(int,input().split()) map(int,input().split()) n list = [int(x) for x in input().split()] [int(x) for x in input().split()] list r = x x r r = max(list) max(list) r k = map(int,input().split()) map(int,input().split()) k
import math

n, k = map(int,input().split())
list = [int(x) for x in input().split()]
list.sort()

l = 0
r = max(list)

while r - l > 1:
  count = 0
  x = (r + l)//2

  for i in range(len(list)):
    if x >= list[i]:
      continue
    count += math.ceil(list[i]/x) - 1

  if count <= k:
    r = x
  else:
    l = x

print(r)

