import kotlin.math.ceil

fun main() = Thread(null, ::abc174e, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc174e() {
    val (n, k) = readLine()!!.split(" ").map { it.toInt() }
    val aList = readLine()!!.split(" ").map { it.toLong() }

    val aListD = aList.map { it.toDouble() }

    // 長さのリミット->必要なカット回数を返す
    fun check(lengthLimit: Long) = aListD.map { ceil(it / lengthLimit).toLong() - 1 }.sum()

    // 答え決め打ちにぶたん
    fun lowerBound(): Long {
        var ng = 0L
        var ok = aList.max()!!

        while (ok - ng > 1) {
            val mid = (ok + ng) / 2
            val check = check(mid)
            if (check <= k) ok = mid else ng = mid
        }
        return ok
    }

    val answer = lowerBound()

    println(answer)
}
