def bsearch_desc(a, b, &proc)
  inverse_proc = -> (n) { proc.call(-n) }
  value *= -1 if value = (-a..-b).bsearch(&inverse_proc)
end

INF = 10 ** 9
n, k = gets.split.map(&:to_i)
nums = gets.split.map(&:to_i)

ans = bsearch_desc(INF, 1) { |length|
  count = 0
  nums.each do |num|
    div, mod = num.divmod(length)
    div += 1 if mod > 0
    count += div - 1
  end
  count > k
} + 1

puts ans
