# AtCoder Regular Contest 067

URL: https://atcoder.jp/contests/arc067 (opens new window)

# D

n,a,b = gets.chomp.split(" ").map(&:to_i)
x_arr = gets.chomp.split(" ").map(&:to_i)

result = 0
x_arr.each_cons(2) do |x1, x2|
  tmp = (x2 - x1) * a
  if tmp > b
    result += b
  else
    result += tmp
  end
end

puts result
Last Updated: 2020/08/09 18:33