n,k = gets.chomp.split(" ").map(&:to_i)
a = gets.chomp.split(" ").map(&:to_i)
d = a.max / 2
v = d
if k == 0
  puts a.max
  exit
end
while d != 0
  cnt = 0
  a.each do |x|
    cnt += (x-1) / v
  end
  d = d / 2
  if k >= cnt
    v -= d
  else
    v += d
  end
end
cnt = 0
a.each do |x|
  cnt += (x-1) / v
end
if k < cnt
  v += 1
else
  v -= 1
  a.each do |x|
    cnt += (x-1) / v
  end
  if k < cnt
    v += 1
  end
end
puts v