from math import ceil
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
def is_ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
  return True
def binary_search(m): 
  left=0
  right=m+1
  while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center
if k==0:
  print(max(a))
else:
  print(binary_search(max(a))) from math import ceil n,k=map(int,input().split()) n map(int,input().split()) map int input().split() ().split () input split k int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i a=[int(i) for i in input().split()] a [int(i) for i in input().split()] def is_ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
  return True is_ok c=0 c 0 for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
   i a c+=ceil(i/x)-1 c ceil(i/x)-1 ceil(i/x) ceil i/x i x 1 if c>k:
      return False
   c>k c k return False False return True True x x def binary_search(m): 
  left=0
  right=m+1
  while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center binary_search left=0 left 0 right=m+1 right m+1 m 1 while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center left<=right left right center=(left+right)//2 center (left+right)//2 left+right left right 2 if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center right-left==1 right-left right left 1 return right right elif is_ok(center):
      right=center
     is_ok(center) is_ok center right=center right center left=center left center m m if k==0:
  print(max(a))
else:
  print(binary_search(max(a))) k==0 k 0 print(max(a)) print max(a) max a print(binary_search(max(a))) print binary_search(max(a)) binary_search max(a) max a n,k=map(int,input().split()) map(int,input().split()) n def binary_search(m): 
  left=0
  right=m+1
  while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center def binary_search(m): 
  left=0
  right=m+1
  while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center binary_search a=[int(i) for i in input().split()] [int(i) for i in input().split()] a k=map(int,input().split()) map(int,input().split()) k def is_ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
  return True def is_ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
  return True is_ok
from math import ceil
n,k=map(int,input().split())
a=[int(i) for i in input().split()]
def is_ok(x):
  c=0
  for i in a:
    c+=ceil(i/x)-1
    if c>k:
      return False
  return True
def binary_search(m): 
  left=0
  right=m+1
  while left<=right:
    center=(left+right)//2
    if right-left==1:
      return right
    elif is_ok(center):
      right=center
    else:
      left=center
if k==0:
  print(max(a))
else:
  print(binary_search(max(a)))