# after YouTube editorial
n,k = gets.strip.split.map(&:to_i)
a = gets.strip.split.map(&:to_i)
l = 0
r = a.max
while r - l > 1
  x = (l+r)/2
  y = 0
  a.each do |e|
    y += (e+x-1)/x-1 if e > x
  end
  if y > k
    l = x
  else
    r = x
  end
end
p r
