program logs
  implicit none
  integer :: n, k, a(200000) = 0, x, i
  integer :: l = 0, r = 2e9, m
  read(*,*) n, k
  read(*,*) a(1:n)
  do while (r - l > 1)
    m = (l + r) / 2
    x = 0
    do i = 1, n
      x = x + (a(i) - 1) / m
    end do
    if (x <= k) then
      r = m
    else
      l = m
    end if
  end do
  write(*,'(i0)') r
end program logs