let n, l = Scanf.scanf " %d %d" @@ fun a b -> a, b
let ts = Array.init n @@ (+) l
let _ = Array.fold_left (+) 0 ts - Array.fold_left (fun m t -> if abs t < abs m then t else m) ts.(0) ts |> Printf.printf "%d\n"