import Foundation

func readInt() -> Int {
    Int(readLine()!)!
}
 
func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}
 
prefix operator *
prefix func * <T> (a: [T]) -> (T, T) {return (a[0], a[1])}
prefix func * <T> (a: [T]) -> (T, T, T) {return (a[0], a[1], a[2])}

func ok(k: Int, a: [Int], v: Int) -> Bool {
    let m = a.lazy.map { 
        Int((Double($0) / Double(v)).rounded(.up)) - 1
    }.reduce(0, +)

    return m <= k
}

func main() {
    let (n, k) = *readInts()
    let a = readInts()

    let ma = a.max()!

    var l = 1
    var r = ma
    while l < r {
        let mid = (l + r) / 2

        if ok(k: k, a: a, v: mid) {
            r = mid
        } else {
            l = mid + 1
        }
    }

    print(r)
}

main()