Scanf.scanf "%d %d" (fun n k ->
    let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun a -> a)) in

    let count m =
        Array.fold_left (fun acc b -> acc + (b + m - 1) / m - 1) 0 a
    in

    let rec loop l r =
        if l = r then l else
            let m = (l + r) / 2 in
            if count m <= k then loop l m else loop (m + 1) r
    in
    loop 1 1000000001 |> Printf.printf "%d\n"
)