fun main() {
    val (n, k) = readInts()
    val logs = readInts()

    var a = 0
    var b = logs.max()!!

    while (b - a > 1) {
        val c = (b + a) / 2
        val cuts = logs.sumBy { log -> ((log + c - 1) / c - 1) }

        if (cuts <= k) b = c
        else a = c
    }
    println(b)
}

private fun readInt() = readLine()!!.toInt()
private fun readInts() = readLine()!!.split(" ").map { it.toInt() }
private fun readLongs() = readLine()!!.split(" ").map { it.toLong() }
