N, K = gets.split.map(&:to_i)
A = gets.split.map(&:to_i)

def f(x)
  cnt = 0

  A.each do |a|
    next if a <= x

    cnt += (a / x.to_f).ceil - 1
  end

  cnt <= K
end

ok = 10 ** 10
ng = 0

while (ok - ng).abs > 1
  x = (ok + ng) / 2

  if f(x)
    ok = x
  else
    ng = x
  end
end

puts ok
