import Foundation

class Scanner {
    static func readInt() -> Int {
        return Int(readLine()!)!
    }
    
    static func readIntArr() -> [Int] {
        return readLine()!.split(separator: " ").map { Int($0)! }
    }
    
    static func readM(_ n: Int) -> [[Int]] {
        var res = [[Int]]()
        for _ in 0..<n {
            res.append(readIntArr())
        }
        return res
    }
    
    static func readUknownIntMat() -> [[Int]] {
        var res = [[Int]]()
        while let line = readLine() {
            res.append(line.split(separator: " ").map { Int($0)! })
        }
        return res
    }
    
    static func readString() -> String {
        return readLine()!
    }
}

class Printer {
    static func printIntArray(_ arr: [Int]) {
        print(arr.map { String($0) }.joined(separator: " "))
    }
}

class Solution {
    func find(_ arr: [Int],
              _ k: Int) -> Int {
        let arr = arr.sorted(by: { $0 > $1 })
        /*
         Find the shortest possible length of the longest log after at most K cuts,
         and print it after rounding up to an integer.
         2 3
         7 9
         */
        var low = 1, high = arr[0]
        while low <= high {
            let mid = low + (high-low)/2
            let res = possible(arr, k, mid)
            if [Size.tooSmall].contains(res) {
                low = mid + 1
            } else {
                high = mid - 1
            }
        }
        return min(low, arr[0])
    }
    
    enum Size {
        case tooBig
        case tooSmall
    }
    func possible(_ arr: [Int], _ k: Int, _ val: Int) -> Size {
        var k = k
        for i in stride(from: arr.count-1, through: 0, by: -1) {
            k -= (arr[i]/val)
        }
        
        return k >= 0 ? .tooBig : .tooSmall
    }
}

let nk = Scanner.readIntArr()
let arr = Scanner.readIntArr()
let sol = Solution()
print(sol.find(arr, nk[1]))
