Problem:
 Score : 500 points    Problem Statement There are N towns on a line running east-west.
The towns are numbered 1 through N , 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 i is X_i .  You are now at town 1 , and you want to visit all the other towns.
You have two ways to travel:    Walk on the line.
Your fatigue level increases by A each time you travel a distance of 1 , regardless of direction.    Teleport to any location of your choice.
Your fatigue level increases by B , 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.  2≤N≤10^5  1≤X_i≤10^9  For all i(1≤i≤N-1) , X_i<X_{i+1} .  1≤A≤10^9  1≤B≤10^9         Input The input is given from Standard Input in the following format:  N  A  B  X_1  X_2  ...  X_N       Output Print the minimum possible total increase of your fatigue level when you visit all the towns.        Sample Input 1 4 2 5
1 2 5 7      Sample Output 1 11  From town 1 , walk a distance of 1 to town 2 , then teleport to town 3 , then walk a distance of 2 to town 4 .
The total increase of your fatigue level in this case is 2×1+5+2×2=11 , which is the minimum possible value.       Sample Input 2 7 1 100
40 43 45 105 108 115 124      Sample Output 2 84  From town 1 , walk all the way to town 7 .
The total increase of your fatigue level in this case is 84 , which is the minimum possible value.       Sample Input 3 7 1 2
24 35 40 68 72 99 103      Sample Output 3 12  Visit all the towns in any order by teleporting six times.
The total increase of your fatigue level in this case is 12 , which is the minimum possible value.

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7

def LI(): return list(map(int,input().split()))
def I(): return int(input())
def LS(): return input().split()
def S(): return input()

def main():
  n,a,b=LI()
  l=LI()

  sm=0
  for i in range(n-1):
    x=l[i+1]-l[i]

    if x*a<b:
      sm+=x*a
    else:
      sm+=b

  return sm

print(main())

Solution (Python):



N,A,B=map(int,input().split())
X = [int(x) for x in input().split()]

ans = 0
for a,b in zip(X[:-1],X[1:]):
  ans += min((b-a)*A,B)
  
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
X=list(map(int,input().split()))
l=[]
for i in range(N-1):
    l.append(min((X[i+1]-X[i])*A,B))
print(sum(l))

Solution (Python):

n, a, b = [ int(v) for v in input().split() ]
town_list = [ int(v) for v in input().split() ]
fatigue_list = [ 0 for i in range(n) ]

for i in range(n-1):
	d = town_list[i+1] - town_list[i]
	fatigue_list[i+1] = fatigue_list[i] + min(a*d,b)
print(fatigue_list[-1])

Solution (Python):
import itertools

n, a, b = map(int, input().split())
x = list(map(int, input().split()))

ans = sum(min(a * abs(p - q), b) for p, q in zip(x, x[1:]))
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
ans=0
X=list(map(int,input().split()))
for i in range(1,N):
    if A*(X[i]-X[i-1])<B:
        ans+=A*(X[i]-X[i-1])
    else:
        ans+=B
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
ans=0
X=list(map(int,input().split()))
for i in range(1,N):
    if A*(X[i]-X[i-1])<B:
        ans+=A*(X[i]-X[i-1])
    else:
        ans+=B
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
sum = 0
for x in range(len(X) -1):
    ds = X[x+1] - X[x]
    sum += min(ds * A, B)

print(sum)

Solution (Python):
N,A,B=map(int,input().split())
now=0
ans=0
for x in map(int,input().split()):
    if now!=0:
        if (x-now)*A>B:
            ans+=B
        else:
            ans+=(x-now)*A
    now=x
print(ans)

Solution (Python):
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
ans=0
if a>=b:
  print(b*(n-1))
else:
  d=b//a
  
  for i in range(n-1):
    if x[i+1]-x[i]>d:
      ans+=b
    else:
      ans+=(x[i+1]-x[i])*a
  print(ans)

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys

mod = 10**9+7
sys.setrecursionlimit(mod) 

N,A,B = map(int,input().split())
X = [int(i) for i in input().split()]

X.sort()
ans = (X[-1]-X[0])*A
for i in range(N-1):
    if (X[i+1] - X[i])*A > B:
        ans += B - (X[i+1] - X[i])*A
print(ans)

Solution (Python):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n , a, b = f()
    x = f()
    dis = [x[i+1] - x[i] for i in range(n-1)]


    ans = 0
    for i in dis:
        if i*a <= b:
            ans += i * a
        else:
            ans += b
    
    print(ans)


solve()

Solution (Python):
n,a,b = map(int, input().split())
x = [int(x) for x in input().split()]
ans = 0

for i in range(0,n-1):
    ans += min((x[i+1]-x[i])*a,b)

print(ans)

Solution (Python):
n,a,b = map(int, input().split())
x = [int(z) for z in input().split()]
ans = 0

for i in range(0,n-1):
    ans += min((x[i+1]-x[i])*a,b)

print(ans)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

ans = 0
for i in range(n-1):
      ans += min(a * (x[i+1] - x[i]), b)


print(ans)

Solution (Python):
N,A,B = [ int(it) for it in input().split() ]
li = [ int(it) for it in input().split() ]
s = 0
for i in range(len(li)-1):
  d = li[i+1] - li[i]
  if (A*d<B):
    ds = d*A
  else:
    ds = B
  s+=ds
print (s)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
ans = 0
for i in range(n - 1):
    ans += min(a * (x[i + 1] - x[i]), b)
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = [int(i) for i in input().split()]

ans = 0
before = X[0]
for i in X:
    ans += min((i-before)*A, B)
    before = i

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))

ans = 0
for i in range(N - 1):
    ans += min((X[i + 1] - X[i]) * A, B)
print(ans)

Solution (Python):
m=lambda:map(int,input().split())
N,A,B=m();*X,=m()
print(sum(min(B,A*(X[i+1]-X[i]))for i in range(N-1)))

Solution (Python):
N,A,B=map(int,input().split())
*X,=map(int,input().split())
ans = 0
for i in range(N-1):
    ans += min(B,A*(X[i+1]-X[i]))
print(ans)

Solution (Python):
def main():
	N, A, B = map(int, input().split())
	X = list(map(int, input().split()))
	ans = 0
	for i in range(1, N):
		walk = (X[i]-X[i-1])*A
		if walk < B:
			ans += walk
		else:
			ans += B
	print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
num = 0
for i in range(N - 1):
    diff = X[i + 1] - X[i]
    num += min(diff * A, B)
print(num)

Solution (Python):
n, a, b = [int(item) for item in input().split()]
x = [int(item) for item in input().split()]

cost = 0
for i in range(1, n):
    walk = (x[i] - x[i-1]) * a 
    if walk > b:
        cost += b
    else:
        cost += walk
print(cost)

Solution (Python):
n, a, b = map(int,input().split())
x = list(map(int,input().split()))
ans = 0

for i in range(n-1):
    ans += min(abs(x[i] - x[i+1]) * a, b)

print(ans)

Solution (Python):
n, a, b = map(int,input().split())
*p, = map(int,input().split())
l = []

for i in range(1,n):
  w = (p[i]-p[i-1])*a 
  if w >= b:
    l.append(b)
  else:
    l.append(w)

print(sum(l))

Solution (Python):
import sys

def main():
    input = sys.stdin.readline
    N, A, B = map(int, input().split())
    X = list(map(int, input().split()))

    diff = [0 for _ in range(N-1)]
    for i in range(N-1):
        diff[i] = X[i+1] - X[i]

    ans = 0
    for d in diff:
        ans += min(A*d, B)

    return ans


if __name__ == '__main__':
    print(main())

Solution (Python):
def walk_and_teleport(N: int, A: int, B: int, X: list)->int:
    pos = X[0]
    cost = 0

    for x in X[1:]:
        cost += min(A * (x - pos), B)
        pos = x

    return cost


if __name__ == "__main__":
    N, A, B = map(int, input().split())
    X = [int(s) for s in input().split()]
    ans = walk_and_teleport(N, A, B, X)
    print(ans)

Solution (Python):
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
ct=0
for i in range(n-1):
  d=x[i+1]-x[i]
  if d*a<b:ct+=d*a
  else:ct+=b
print(ct)

Solution (Python):
n,a,b=map(int,input().split())
x=list(map(int,input().split()))
c=0
for i in range(1,n):
    c+=min((x[i]-x[i-1])*a,b)
print(c)

Solution (Python):


n,a,b = map(int,input().split())
x = list(map(int,input().split()))

fatigue = 0

for i in range(1,n):
    if (x[i] - x[i-1]) * a <= b:
        fatigue += (x[i] - x[i-1]) * a
    else:
        fatigue += b

print(fatigue)

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    X = [x for x in map(int, input().split())]
    ans = 0
    for i in range(1, N):
        dist = X[i] - X[i-1]
        if dist*A < B:
            ans += dist*A
        else:
            ans += B
    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
N, A, B = list(map(int, input().split()))
X = list(map(int, input().split()))
ans = sum([min((X[i+1]-X[i])*A, B) for i in range(N-1)])

print(ans)

Solution (Python):
N,A,B = map(int,input().split())
L = list(map(int,input().split()))
exhaust = 0
for i in range(1,N):
  if (L[i]-L[i-1])*A <= B:
    exhaust += (L[i]-L[i-1])*A
  else:
    exhaust += B
print(exhaust)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

if a > b:
    print(b * (n - 1))
    exit()

d = b // a + 1

ans = 0
for i in range(n-1):
    temp = x[i+1] - x[i]
    if temp >= d:
        ans += b
    else:
        ans += temp * a

print(ans)

Solution (Python):
n, a, b = map(int, input().split())
X = list(map(int, input().split()))
fatigue = 0
for i in range(n-1):
    dis_X= X[i+1]-X[i]
    if(a*dis_X >= b):
        fatigue += b
    else:
        fatigue += a*dis_X
print(fatigue)

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("GREATER")
    elif (x<y): print("LESS")
    else: print("EQUAL")

def ip():
    return int(input())


def calculate(a):
    s = 0
    for i in range(len(a)):
        for k in range(i+1,len(a)):
            s+=(a[i]*a[k])
    return s



n,a,b = (int(i) for i in input().split())    

s = [int(i) for i in input().split()]        







ans = 0
for i in range(n-1):
    ans+=min(b,(s[i+1]-s[i])*a)
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
ans = 0
for i in range(n-1):
  ans += min(a*(x[i+1]-x[i]), b)
print(ans)

Solution (Python):

from collections import defaultdict
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
mod = 1000000007






"""
def factor(n):
    i = 2
    m = n
    while m >= i:
        while m%i == 0:
            m //= i
            d[i] += 1
            d[i] %= mod
            if m < i:break
        i += 1
n = I()
d = defaultdict(int)
for i in range(2,n+1):
    factor(i)
ans = 1
for i in d.values():
    ans *= i+1
    ans %= mod
print(ans)
"""


n,a,b = LI()
x = LI()
ans = 0
for i in range(n-1):
    if a*(x[i+1]-x[i]) > b:
        ans += b
    else:
        ans += a*(x[i+1]-x[i])
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
X=list(map(int,input().split()))
from collections import deque
X=deque(X)
cost=0
now=X.popleft()
while len(X)>0:
    if (X[0]-now)*A<=B:
        cost+=(X[0]-now)*A
    else:cost+=B
    now=X.popleft()
print(cost)

Solution (Python):
n,a,b = map(int,input().split())
x = list(map(int,input().split()))
ans = 0

for i in range(n-1):
  if a*(x[i+1]-x[i]) > b:
    ans = ans+b
  else:
    ans = ans+a*(x[i+1]-x[i])
    
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
X=list(map(int,input().split()))
ans=0
for i in range(1,N):
  s=A*(X[i]-X[i-1])
  if s<=B:
    ans+=s
  else:
    ans+=B
print(ans)

Solution (Python):
N,A,B = map(int, input().split())
x =  list(map(int, input().split()))
m = x[0]
s = 0
for i in range(1,N):
    t = x[i] - x[i-1]
    s += min(B,t*A)
print(s)

Solution (Python):



def main():
    n, a, b = map(int, input().split())
    x = list(map(int, input().split()))
    ans = 0

    for i in range(n - 1):
        ans += min((x[i + 1] - x[i]) * a, b)

    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
n,a,b = map(int,input().split())
x = list(map(int,input().split()))
ans = 0
for i in range(n-1):
    ans += min(b,(x[i+1]-x[i])*a)

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
L = list(map(int, input().split()))
res = 0
for i in range(N-1):
    if A*(L[i+1]-L[i]) < B:
        res += A*(L[i+1]-L[i])
    else:
        res += B
print(res)

Solution (Python):


import sys
import heapq
from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n, a, b = LI()
X = LI()
C = []
for i in range(n - 1):
    C.append(X[i + 1] - X[i])

ans = 0
for i in range(n - 1):
    ans += min(a * C[i], b)

print(ans)

Solution (Python):
n,a,b=map(int,input().split())
X=list(map(int,input().split()))
ans=0
for i in range(n-1):
    ans+=min(a*(X[i+1]-X[i]),b)
print(ans)

Solution (Python):
n,a,b=map(int,input().split())
X=list(map(int,input().split()))
D=[]
for i in range(n-1):
    D.append(X[i+1]-X[i])
ans=0
for i in range(n-1):
    ans+=min(a*D[i],b)
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
X=list(map(int,input().split()))

ANS=0

for i in range(1,N):
    if (X[i]-X[i-1])*A>=B:
        ANS+=B
    else:
        ANS+=(X[i]-X[i-1])*A
    
print(ANS)

Solution (Python):
N,A,B = map(int,input().split())
X = list(map(int,input().split()))

ans = 0
t = 1
for i in range(len(X)-1):
    ans += min((X[i+1] - X[i])*A,B)
print(ans)

Solution (Python):
n,a,b=map(int,input().split())
v=0
*x,=map(int,input().split())
for i in range(n-1):
    v+=min(a*(x[i+1]-x[i]),b)
print(v)

Solution (Python):
n,a,b=map(int,input().split())
v=0
*x,=map(int,input().split())
for i in range(n-1):
    v+=min(a*(x[i+1]-x[i]),b)
print(v)

Solution (Python):
n,a,b=map(int,input().split())
v=0
*x,=map(int,input().split())
for i in range(n-1):
    v+=min(a*(x[i+1]-x[i]),b)
print(v)

Solution (Python):
N, A, B = map(int, input().split())

X = list(map(int, input().split()))
X = [x - X[0] for x in X]

C = 0

for i in range(1, N):
    C_A = (X[i] - X[i-1]) * A
    if C_A < B:
        C += C_A
    else:
        C += B

print(C)

Solution (Python):
def solve():
    [N,A,B] = [int(n) for n in input().split()]
    X = [int(x) for x in input().split()]
    
    ans = 0

    for i in range(1, N):
        ans += min(A * abs(X[i]-X[i-1]), B)

    return ans


if __name__ == '__main__':
    print(solve())

Solution (Python):
N, A, B = map(int, input().split())
x = list(map(int, input().split()))

ans = 0
for i in range(1, N):
    ans += min((x[i] - x[i - 1]) * A, B)
print(ans)

Solution (Python):


import sys
def input(): return sys.stdin.readline().strip()
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N, A, B = map(int, input().split())
xN = list(map(int, input().split()))

ans = 0
for i in range(1, N):
    ans += min((xN[i] - xN[i-1]) * A, B)
print(ans)

Solution (Python):
n,a,b = (int(i) for i in input().split())
x = list(int(i) for i in input().split())
ans = 0
for i in range(n-1):
 dist  = x[i+1]-x[i]
 move = dist*a
 if move <= b:
  ans += move
 else:
  ans += b
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X_arr = list(map(int, input().split()))
X_diff = []
for i in range(N-1):
    X_diff.append(X_arr[i+1] - X_arr[i])

ans = 0
for d in X_diff:
    if d * A < B:
        ans += d * A
    else:
        ans += B
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))

ans = 0
for i in range(1, N):
    ans += min(A * (X[i] - X[i - 1]), B)

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
x_list = list(map(int, input().split()))

ans = 0

for i in range(1, N):
    ans += min(B, A * (x_list[i] - x_list[i - 1]))
print(ans)

Solution (Python):
N,A,B = map(int,input().split())
X = list(map(int,input().split()))

ans = 0
for i in range(N-1):
    ans += min(B,A*(X[i+1]-X[i]))

print(ans)

Solution (Python):
n, a, b = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = 0

for i in range(n-1):
  if a*(x[i+1]-x[i]) >= b:
    ans += b
  else:
    ans += a*(x[i+1]-x[i])

print(ans)

Solution (Python):
def main():
    n, a, b = map(int, input().split())
    xs = list(map(int, input().split()))
    res = 0
    for i in range(n - 1):
        res += min(b, (xs[i + 1] - xs[i]) * a)
    print(res)


if __name__ == '__main__':
    main()

Solution (Python):

n, a, b = map(int, input().split())
x = input().split()
x = [int(m) for m in x]

ans = 0
for i in range(1, n):
    k = x[i] - x[i - 1]
    if k * a < b:
        ans += k * a
    else:
        ans += b

print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = [int(x) for x in input().split()]
D = [X[i + 1] - X[i] for i in range(N - 1)]
ans = 0
for d in D:
  ans += min(d * A, B)
print(ans)

Solution (Python):
N, A, B = list(map(int, input().split()))
X = list(map(int, input().split()))
now = X[0]
res = 0
for i in X[1:]:
	if(i-now)*A < B:
		res += (i-now)*A
	else:
		res += B
	now = i
	
print(res)

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    N, A, B = li_input()
    X = li_input()

    ans = 0
    for i in range(len(X) - 1):
        if (X[i+1] - X[i]) * A < B:
            ans += (X[i+1] - X[i]) * A
        else:
            ans += B
    
    print(ans)


main()

Solution (Python):
n, a, b = [int(i) for i in input().split()]
X = [int(i) for i in input().split()]

ans = 0
for i in range(n-1):
  ans += min(a * (X[i+1] - X[i]), b)

print(ans)

Solution (Python):
N,A,B = map(int,input().split())
X = list(map(int,input().split()))
ans = 0
for i in range(N-1):
    d = X[i+1]-X[i]
    ans += min(A*d,B)
print(ans)

Solution (Python):
ar = list(map(int,input().split(" ")))
br = list(map(int,input().split(" ")))
count = 0
for i in range(ar[0]-1):
    if (br[i+1] - br[i]) * ar[1] < ar[2]:
        count += (br[i+1] - br[i]) * ar[1]
    else:
        count += ar[2]
print(count)

Solution (Python):
N, A, B = map( int, input().split())
X = list( map( int, input().split()))
now = X[0]
ans = 0
for i in range(1,N):
    x = X[i]
    if (x-now)*A >= B:
        ans += B
    else:
        ans += A*(x-now)
    now = x
print(ans)

Solution (Python):
n,a,b = map(int,input().split())
x = list(map(int,input().split()))

ass = 0
r = x[0]
for i in range(1,n):
    ass += min([(x[i]-r)*a,b])
    r = x[i]
print(ass)

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))

cost = 0
for i in range(N - 1):
    cost += min(A * abs(X[i + 1] - X[i]), B)

print(cost)

Solution (Python):
N, A, B = map(int, input().split())
X = list(map(int, input().split()))
x1 = X[0]
cost = [min(A * abs(X[i + 1] - X[i]), B) for i in range(N - 1)]

print(sum(cost))

Solution (Python):
n,a,b = map(int,input().split())
x = list(map(int,input().split()))
t = 0

for i in range(n-1):
	if (x[i+1]-x[i])*a>b:
		t += b
	else:
		t += (x[i+1]-x[i])*a
print(t)

Solution (Python):
N, A, B = map(int, input().split())
X = [int(_) for _ in input().split()]
F = 0
for i in range(1, N):
    if A * (X[i] - X[i-1]) >= B:
        F += B
    else:
        F += A * (X[i] - X[i-1])
print(F)

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def main():
    N, A, B = map(int, input().split())
    X = list(map(int, input().split()))
    cost = 0
    for i in range(N - 1):
        d = X[i + 1] - X[i]
        cost += min(d * A, B)
    print(cost)


if __name__ == '__main__':
    main()

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
x.sort()
ans = 0
for i in range(n - 1):
    ans += min(a * (x[i + 1] - x[i]), b)
print(ans)

Solution (Python):
def d_walk_and_teleport(N, A, B, X):
    
    ans = sum([min(A * (X[k + 1] - X[k]), B) for k in range(N - 1)])
    return ans

N,A,B = [int(i) for i in input().split()]
X = [int(i) for i in input().split()]
print(d_walk_and_teleport(N, A, B, X))

Solution (Python):
N,A,B = map(int, input().split())
X = list(map(int, input().split()))

ans = 0
for i in range(1,N):
  ans += min(B, (X[i]-X[i-1])*A)
  
print(ans)

Solution (Python):
N,A,B=map(int,input().split())
X=list(map(int,input().split()))

ans=0
for i in range(1,len(X)):
    if (X[i]-X[i-1])*A>B:
        ans+=B
    else:
        ans+=(X[i]-X[i-1])*A
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

ans = 0

for i in range(n-1):
    if x[i+1] - x[i] <= b // a:
        ans += a * (x[i+1] - x[i])
    else:
        ans += b

print(ans)

Solution (Python):

import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

n,a,b = li()
x = li()

ans = 0
for i in range(n-1):
    if a*(x[i+1]-x[i]) > b:
        ans += b
        
    else:
        ans += a*(x[i+1]-x[i])
        
print(ans)

Solution (Python):
N,A,B = map(int,input().split())
X = list(map(int,input().split()))

ans = 0
now = X[0]
for x in X[1:]:
    d = x - now
    if d*A < B:
        ans += d*A
    else:
        ans += B
    now = x
print(ans)

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))
pre = x[0]
num = 0
for i in range(1, n):
    num += min((x[i] - pre) * a, b)
    pre = x[i]

print(num)

Solution (Python):
n, a, b = list(map(int, input().split()))
x = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    ans += min((x[i+1]-x[i])*a, b)
    
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
x = list(map(int, input().split()))
ans = 0
for i in range(N - 1):
    ans += min((x[i + 1] - x[i]) * A, B)
print(ans)

Solution (Python):
n,a,b = map(int,raw_input().split())

arr = map(int,raw_input().split())

ans = 0

for i in range(1,n):
	ans += min(b,(arr[i] - arr[i-1])*a)

print ans

Solution (Python):


import bisect
import heapq
import math
import random
import sys
from pprint import pprint
from collections import Counter, defaultdict, deque
import queue
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, X):
    ans = 0
    c = X[0]
    for x in X[1:]:
        ac = A*(x - c)
        if ac > B:
            ans += B
        else:
            ans += ac
        c = x

    return ans


def main():
    N, A, B = read_int_n()
    X = read_int_n()

    print(slv(N, A, B, X))


if __name__ == '__main__':
    main()

Solution (Python):


import bisect
import heapq
import math
import random
import sys
from pprint import pprint
from collections import Counter, defaultdict, deque
import queue
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(N, A, B, X):
    ans = 0
    c = X[0]
    for x in X[1:]:
        ac = A*(x - c)
        if ac > B:
            ans += B
        else:
            ans += ac
        c = x

    return ans


def main():
    N, A, B = read_int_n()
    X = read_int_n()

    print(slv(N, A, B, X))


if __name__ == '__main__':
    main()

Solution (Python):
from collections import deque

N,A,B = map(int, input().split())
X = list(map(int, input().split()))

INF = float("inf")

dist = deque(X)

next_x = +1
i = 0
ans = 0
while len(dist) != 1:

    if A*abs(dist[i+next_x] - dist[i]) <= B:
        ans += A*abs(dist[i+next_x] - dist[i])
        if next_x == 1:
            dist.popleft()
            i = 0
        else:
            dist.pop()
            i = len(dist)-1
    else:
        ans += B
        if next_x == 1:
            dist.popleft()
            i = len(dist)-1
        else:
            dist.pop()
            i = 0
        
        next_x = -next_x
        
print(ans)

Solution (Python):
n, a, b = list(map(int, input().split()))
x = list(map(int, input().split()))

ans = 0
for i in range(n-1):
    if (x[i+1]-x[i])*a > b:
        ans += b
    else:
        ans += (x[i+1]-x[i])*a

print(ans)

Solution (Python):
n,a,b=map(int,input().split())
x=list(map(int,input().split()))

ans=0

for i in range(n-1):
    da=a*(x[i+1]-x[i])
    if da>b:
        ans+=b
    else:
        ans+=da

print(ans)

Solution (Python):
n, a, b = input().split(" ")
n = int(n)
a = int(a)
b = int(b)
xs = input().split(" ")
m = list()
for x in xs:
	m.append(int(x))

fatigue = list()
for index, x in enumerate(m):
	if index < len(m) - 1:
		dist = abs(m[index + 1] - x)
		fatigue.append(min((a * dist), b))

print(sum(fatigue))

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

print(sum([min(a * (v - u), b) for u, v in zip(x[:-1], x[1:])]))

Solution (Python):
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

acc = 0 
for u, v in zip(x[:-1], x[1:]):
    acc += min(a * (v - u), b)

print(acc)

Solution (Python):
n, a, b = map(int, input().split())
x = map(int, input().split())

acc = 0
c = next(x)
for p in x:
    d = p - c
    acc += min(a * d, b)
    c = p
    
print(acc)

Solution (Python):
N, A, B = map(int, input().split())
x = [int(xi) for xi in input().split()]

print(sum([min((x[i+1] - x[i]) * A, B) for i in range(0, N-1)]))

Solution (Python):
n,a,b = map(int, input().split())
X = list(map(int, input().split()))

score = 0
telepo = b
for i in range(len(X)-1):
    walk = (X[i+1]-X[i])*a
    score += min(walk, telepo)
print(score)

Solution (Python):
N, A, B = map(int, input().split())
x = [int(xi) for xi in input().split()]

costs = [(x[i+1] - x[i]) * A for i in range(0, N-1)]
print(sum([min(ci, B) for ci in costs]))