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

let rec f l r =
  if r <= l then r
  else
    let m = (l + r) / 2 in
    let k' = Array.fold_left (fun i j -> i + (j - 1) / m) 0 a in
    if k < k' then f (m + 1) r
    else f l m

let () = Printf.printf "%d\n" (f 1 1000000000)
