import java.io.BufferedReader

fun main() {
    val br = System.`in`.bufferedReader()
    val sb = StringBuilder()
    val n = br.readInt()
    var k = br.readInt()
    val lengths = IntArray(n) { br.readInt() }
    fun isPossible(length: Int): Boolean {
        var numCuts = 0L
        for (l in lengths) {
            numCuts += (l - 1) / length
        }
        return numCuts <= k
    }


    var low = 1
    var high = 1_000_000_001
    var mid = (low + high) shr 1
    while (low != high) {
        if (isPossible(mid)) {
            high = mid
        } else {
            low = mid + 1
        }
        mid = (low + high) shr 1
    }
    print(high)
}

private const val SPACE_INT = ' '.toInt()
private const val ZERO_INT = '0'.toInt()
private const val NL_INT = '\n'.toInt()

private fun BufferedReader.readInt(): Int {
    var ret = read()
    while (ret <= SPACE_INT) {
        ret = read()
    }
    val neg = ret == '-'.toInt()
    if (neg) {
        ret = read()
    }
    ret -= ZERO_INT
    var read = read()
    while (read >= ZERO_INT) {
        ret *= 10
        ret += read - ZERO_INT
        read = read()
    }

    while (read <= SPACE_INT && read != -1 && read != NL_INT) {
        mark(1)
        read = read()
    }
    if (read > SPACE_INT) {
        reset()
    }
    return if (neg) -ret else ret
}