import java.io.BufferedReader
import java.io.InputStreamReader

fun main() {
    val jin = BufferedReader(InputStreamReader(System.`in`))
    val line = jin.readLine().split(" ")
    val n = line[0].toInt()
    val k = line[1].toLong()
    val logs = jin.readLine().split(" ").map { it.toLong() }
    var upper = logs.max()!!
    var lower = 1L
    while (upper > lower) {
        val mid = (upper + lower) / 2L
        var cuts = 0L
        for (log in logs) {
            cuts += (log - 1L) / mid
        }
        if (cuts <= k) {
            upper = mid
        } else {
            lower = mid + 1L
        }
    }
    println(upper)
}