object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val n, k = sc.nextInt()
  val as = List.fill(n)(sc.nextLong())

  def binSearch(begin: Int, end: Int): Int = {
    def check(x: Int): Boolean = {
      as.map(a => ((a + x - 1) / x - 1).max(0)).sum <= k
    }

    if (end - begin <= 1) {
      end
    } else {
      val m = begin + (end - begin) / 2
      if (check(m)) binSearch(begin, m) else binSearch(m, end)
    }
  }

  println(binSearch(0, Int.MaxValue))
}
