require 'set'; require 'prime'; require 'pp'
INF=Float::INFINITY; MOD=10**9+7
n,k = gets.chomp.split.map(&:to_i)
a = gets.chomp.split.map(&:to_i)
@a = a.sort.reverse
@n = n
@k = k

l = 0
r = 10**9

def ok?(len)
  count = 0
  @n.times do |i|
    break if @a[i] <= len
    count += (@a[i] / len) - 1
    count += 1 if @a[i] % len != 0
    # p [len, 'ok?', i, @a[i], count]
    return false if count > @k
  end
  true
end

while l < r
  mid = (l + r) / 2
  if mid == 0
    l = 1
    break
  end

  # p [[l, r], mid, ok?(mid)]
  if ok?(mid)
    r = mid
  else
    l = mid + 1
  end
end

puts l


