class BinarySearch
  def initialize(t, &b)
    @t = t
    @b = b
  end
  def search(f, t, isMin)
    return isMin ? t : f if f-t == 1
    m = (f+t)/2
    n = @b.call(m)
    if n > @t || (n==@t && isMin) then
      search(f, m, isMin)
    else
      search(m, t, isMin)
    end
  end
end

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

(puts A.max; exit) if K == 0
(puts 1; exit) if K >= A.inject(:+) - N

bs = BinarySearch.new(K){|x|
  A.inject(0){|r, a|
    r + (a+x-1)/x - 1
  }
}

puts bs.search(A.max, 1, false)
