let ans, n, a, b, ds, xs = Scanf.scanf "%d %d %d" @@ fun n a b -> Array.(ref max_int, n, a, b, make n 0, init n @@ fun _ -> Scanf.scanf " %d" (+) 0)
let _ = for i = 1 to n - 1 do ds.(i - 1) <- xs.(i) - xs.(i - 1) done; Array.(sort (-) ds; iteri (fun i d -> if i > 0 then ds.(i) <- ds.(i) + ds.(i - 1)) ds); for w = 0 to n - 1 do ans := min !ans @@ ds.(w) * a + (n - 1 - w) * b done; Printf.printf "%d\n" !ans