atcoder#ARC067B. [ABC052D] Walk and Teleport

[ABC052D] Walk and Teleport

Score : 500500 points

Problem Statement

There are NN towns on a line running east-west. The towns are numbered 11 through NN, in order from west to east. Each point on the line has a one-dimensional coordinate, and a point that is farther east has a greater coordinate value. The coordinate of town ii is XiX_i.

You are now at town 11, and you want to visit all the other towns. You have two ways to travel:

  • Walk on the line. Your fatigue level increases by AA each time you travel a distance of 11, regardless of direction.
  • Teleport to any location of your choice. Your fatigue level increases by BB, regardless of the distance covered.

Find the minimum possible total increase of your fatigue level when you visit all the towns in these two ways.

Constraints

  • All input values are integers.
  • 2N1052 \leq N \leq 10^5
  • 1Xi1091 \leq X_i \leq 10^9
  • For all i(1iN1)i(1 \leq i \leq N-1), $X_i.
  • 1A1091 \leq A \leq 10^9
  • 1B1091 \leq B \leq 10^9

Input

The input is given from Standard Input in the following format:

NN AA BB

X1X_1 X2X_2 ...... XNX_N

Output

Print the minimum possible total increase of your fatigue level when you visit all the towns.

4 2 5
1 2 5 7
11

From town 11, walk a distance of 11 to town 22, then teleport to town 33, then walk a distance of 22 to town 44. The total increase of your fatigue level in this case is 2×1+5+2×2=112 \times 1+5+2 \times 2=11, which is the minimum possible value.

7 1 100
40 43 45 105 108 115 124
84

From town 11, walk all the way to town 77. The total increase of your fatigue level in this case is 8484, which is the minimum possible value.

7 1 2
24 35 40 68 72 99 103
12

Visit all the towns in any order by teleporting six times. The total increase of your fatigue level in this case is 1212, which is the minimum possible value.