let rec lower_bound l r p =
  if r <= 1 + l
  then r
  else let m = (l + r) / 2 in
       if p m
       then lower_bound l m p
       else lower_bound m r p

let () = Scanf.scanf "%d %d\n" @@ fun n k ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ Fun.id in
  Printf.printf "%d\n" @@
  lower_bound 0 10000000000 @@ fun l ->
    ( >= ) k @@
    Array.fold_right (fun a -> ( + ) @@ (a - 1) / l) as_ 0