let [|_;K|] =
    stdin.ReadLine().Split()
    |> Array.map int
let A =
    stdin.ReadLine().Split()
    |> Array.map int

let maxA = Array.max A

let ansLt x =
    let k = Array.sumBy (fun item -> (item + x - 1)/x - 1) A
    k <= K

let rec culc low upper =
    if upper - low = 1 then low
    else
        let middle = (low + upper + 1) / 2
        if ansLt (middle - 1) then culc low middle
        else culc middle upper

culc 1 (maxA+1)
|> stdout.WriteLine