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 sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)
 

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
 
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
 
 


def warshall_floyd(d, n):
    
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
 
 

def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d
 

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 

def lcm(x, y):
    return (x * y) // gcd(x, y)
 

def lcm_list(numbers):
    return reduce(lcm, numbers, 1)
 

def gcd_list(numbers):
    return reduce(gcd, numbers)
 

 
 
 

def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
 
    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P
 

def permutation_with_duplicates(L):
 
    if L == []:
        return [[]]
 
    else:
        ret = []
 
        
        S = sorted(set(L))
 
        for i in S:
 
            data = L[:]
            data.remove(i)
 
            for j in permutation_with_duplicates(data):
                ret.append([i] + j)
 
        return ret
 
 
n,a,b=map(int,input().split())
l = list(map(int,input().split()))
ans=0
for i in range(1,n):
    ans+=min((l[i]-l[i-1])*a,b)
print(ans)

Solution (Python):
import sys
import heapq
import re
from itertools import permutations
from bisect import bisect_left, bisect_right
from collections import Counter, deque
from fractions import gcd
from math import factorial, sqrt, ceil
from functools import lru_cache, reduce
INF = 1 << 60
MOD = 1000000007
sys.setrecursionlimit(10 ** 7)
 

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n
 
    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]
 
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
 
        if x == y:
            return
 
        if self.parents[x] > self.parents[y]:
            x, y = y, x
 
        self.parents[x] += self.parents[y]
        self.parents[y] = x
 
    def size(self, x):
        return -self.parents[self.find(x)]
 
    def same(self, x, y):
        return self.find(x) == self.find(y)
 
    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]
 
    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]
 
    def group_count(self):
        return len(self.roots())
 
    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}
 
    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
 
def is_prime(n):
    if n == 1:
        return False
    for i in range(2,int(n**0.5)+1):
        if n % i == 0:
            return False
    return True
 
 


def warshall_floyd(d, n):
    
    for k in range(n):
        for i in range(n):
            for j in range(n):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d
 
 

def dijkstra_heap(s, edge, n):
    
    d = [10**20] * n
    used = [True] * n 
    d[s] = 0
    used[s] = False
    edgelist = []
    for a,b in edge[s]:
        heapq.heappush(edgelist,a*(10**6)+b)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        
        if not used[minedge%(10**6)]:
            continue
        v = minedge%(10**6)
        d[v] = minedge//(10**6)
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,(e[0]+d[v])*(10**6)+e[1])
    return d
 

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
 
    if temp!=1:
        arr.append([temp, 1])
 
    if arr==[]:
        arr.append([n, 1])
 
    return arr
 

def lcm(x, y):
    return (x * y) // gcd(x, y)
 

def lcm_list(numbers):
    return reduce(lcm, numbers, 1)
 

def gcd_list(numbers):
    return reduce(gcd, numbers)
 

 
 
 

def eratosthenes(limit):
    A = [i for i in range(2, limit+1)]
    P = []
 
    while True:
        prime = min(A)
        
        if prime > sqrt(limit):
            break
            
        P.append(prime)
            
        i = 0
        while i < len(A):
            if A[i] % prime == 0:
                A.pop(i)
                continue
            i += 1
            
    for a in A:
        P.append(a)
            
    return P
 

def permutation_with_duplicates(L):
 
    if L == []:
        return [[]]
 
    else:
        ret = []
 
        
        S = sorted(set(L))
 
        for i in S:
 
            data = L[:]
            data.remove(i)
 
            for j in permutation_with_duplicates(data):
                ret.append([i] + j)
 
        return ret
 
 
n,a,b=map(int,input().split())
l = list(map(int,input().split()))
ans=0
for i in range(1,n):
    ans+=min((l[i]-l[i-1])*a,b)
print(ans)

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

cost = 0
for i in range(1,n):
    diff = x_ls[i] - x_ls[i-1]
    if diff * a < b:
        cost += diff * a
    else:
        cost += b
print(cost)

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

Solution (Python):

import sys
input = sys.stdin.readline









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]
    if d*A > B:
        ans += B
    else:
        ans += d*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(B,A*(x[i+1]-x[i]))

print(ans)

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    n, a, b = mi()
    L = lmi()
    diff = [L[i] - L[i-1] for i in range(1, n)]
    cost = 0
    for elm in diff:
        cost += min(elm * a, b)
    print(cost)


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(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()))

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

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

abc052_d()

Solution (Python):

import numpy as np
N, A, B = map(int, input().split())
X = np.array(list(map(int, input().split())))
diff = np.diff(X)
ans = 0
for d in 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):
  d = X[i] - X[i-1]
  ans += min(A*d, B)
  
print(ans)

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

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

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

dp=[float("inf")]*N
dp[0]=0

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

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 = [int(_) for _ in input().split()]
X = [int(_) for _ in input().split()]
p = [B] * (N - 1)
for i in range(N - 1):
    if (X[i + 1] - X[i]) * A < B:
        p[i] = (X[i + 1] - X[i]) * A
print(sum(p))

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



dp = [0] * n

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

ans = sum(dp)
print(ans)

Solution (Python):
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]

from collections import defaultdict, deque
from sys import exit
import heapq
import math
import copy
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)

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

Solution (Python):
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]




N, A, B = mi()
X = li()

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

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

i=1
cnt=0
while i<n:
    if (x[i]-x[i-1])*a>b:
        cnt+=b
    else:
        cnt+=(x[i]-x[i-1])*a
    i+=1

print(cnt)

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

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






dp = [-1] * (N + 1)
dp[0], dp[1] = 0, 0

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


print(dp[-1])

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

if A >= B:
    print((N - 1) * B)
    exit()






dp = [-1] * (N + 1)
dp[0], dp[1] = 0, 0

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


print(dp[-1])

Solution (Python):
import sys
readline = sys.stdin.readline

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

if __name__ == '__main__':
    main()

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

Solution (Python):
n,a,b = map(int,input().split())
x = list(map(int,input().split()))
xdif = [x2-x1 for x1,x2 in zip(x,x[1:])]
ans = sum(dx*a if dx*a <b  else b for dx in xdif)
print(ans)

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

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):
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9 + 7

x,a,b = map(int,input().split())
li = list(map(int,input().split()))
diff = []
for i in range(len(li)-1):
    c = li[i+1]-li[i]
    diff.append(c)
for i in range(len(diff)):
    diff[i] = min(diff[i]*a,b)
print(sum(diff))

Solution (Python):
n,a,b = map(int,input().split())
X = list(map(int,input().split()))
pos = X[0]
ans = 0
for i in range(1, n):
    ans += min(b, (X[i] - pos)*a)
    pos = 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(n - 1):
  d = x[i + 1] - x[i]
  ans += min(d * a, b)
print(ans)

Solution (Python):

N, A, B, *X = map(int, open(0).read().split())

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

print(ans)

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


dlist =[0]*(n-1)

for i in range(0,n-1):
    dlist[i] = (Alist[i+1] - Alist[i])*a

res = 0
for i in range(0,n-1):
    if dlist[i] > b:
        res += b
    else:
        res += dlist[i]

print(res)

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

diff = [x[i] - x[i-1] for i in range(1, n)]

res = 0
for d in diff:
	res += min(d * a, b)

print(res)

Solution (Python):
import sys


def input():
    return sys.stdin.readline().strip()


sys.setrecursionlimit(20000000)


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


if __name__ == "__main__":
    main()

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

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

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

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

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

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
rl = sys.stdin.readline


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


if __name__ == '__main__':
    solve()

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]
    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(n - 1):
    ans += min((x[i + 1] - x[i]) * a, b)

print(ans)

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

res = 0
for i in range(N-1):
    if x[i+1]-x[i] > k:
        res += B
    else:
        res += (x[i+1]-x[i])*A
print(res)

Solution (Python):
nums1 = [int(e) for e in input().split()]
nums2 = [int(t) for t in input().split()]
ans = 0
N = nums1[0]
A = nums1[1]
B = nums1[2]
for i in range(0,N-1):
    if(nums2[i+1]-nums2[i])*A > B:
        ans+=B
    else:
        ans+=(nums2[i+1]-nums2[i])*A
print(ans)

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

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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

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

print(t)

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()))
cnt=0
for i in range(N-1):
    if A*(X[i+1]-X[i])>B:
        cnt=cnt+B
    else:
        cnt=cnt+A*(X[i+1]-X[i])
print(cnt)

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())
ns = list(map(int, input().split()))
dis = [ns[i + 1] - ns[i] for i in range(n - 1)]
ttl = 0
for i in range(0, n-1):
    ttl += min(dis[i] * a, b)
print(ttl)

Solution (Python):

import io
nim, mike, kite = map(int, input().split())
array = list(map(int, input().split()))
    
ans = 0
for i in range(1, nim):
    ans += min((array[i] - array[i - 1]) * mike, kite)
print(ans)

Solution (Python):
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

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):
def main():
    
    
    

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

    pos = X[0]
    cnt = 0
    for x in X:
        walk = (x - pos) * A
        tele = B
        if walk < tele:
            cnt += walk
        else:
            cnt += tele
        pos = x
    
    print(cnt)


if __name__ == "__main__":
    main()

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

Solution (Python):
def input_multiple_number():
    return map(int, input().split())

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

N,A,B = input_multiple_number()
list_X = input_multiple_number_as_list()

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

print(ans)

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

ans=0
pre=X[0]

for xi in X[1:]:
    if (xi-pre)*A-B>0:
        ans+=B
    else:
        ans+=(xi-pre)*A
    pre=xi

print(ans)

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

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

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

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

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

x = list(map(int,input().split()))

diff_x = []

for i in range(1,n):
    diff_x.append((x[i]-x[i-1])*a)

for i in range(n-1):
    if diff_x[i] > b:
        diff_x[i] = b

print(sum(diff_x))

Solution (Python):
n,a,b = map(int, input().split())
x = list(map(int, input().split()))
ans = 0
for i in range(0,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):
  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):
    walk_i = (x[i+1] - x[i])*a
    tel_i = b
    ans+=min(walk_i,tel_i)
print(ans)

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((X[i+1] - X[i]) * A, B)
print(ans)

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

X.sort()

group=[[X[0]]]
for i in range(N-1):
    if (X[i+1] - X[i]) * A > B:
        group.append([X[i+1]])
    else:
        group[-1].append(X[i+1])


ans = (len(group) - 1) * B
for g in group:
    ans += (max(g) - min(g)) * A
print(ans)

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

xrui = []
ans = 0
for i in range(n-1):
    xrui.append(x[i + 1] - x[i])

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

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

t = list(map(int,input().split()))

t.sort()

dp=[0]*n

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

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(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())
xi = [int(i) for i in input().split()]

ans = 0

for i in range(1,n):
    tmp_a = (xi[i] - xi[i-1])*a
    if tmp_a >= b:
        ans += b
    else:
        ans += tmp_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, n):
    ans += min(b,(x[i] - x[i-1]) * a)
print(ans)

Solution (Python):
N, A, B = map(int, input().split())
X = tuple(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):
    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()))
dp = [10**9]*(n+1)
dp[0] = 0
for i in range(n - 1):
    dp[i + 1] = min(dp[i] + a*(x[i + 1]-x[i]), dp[i] + b)
print(dp[n-1])

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

ans = 0

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

print(ans)

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

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, input().split())
X = tuple(map(int, input().split()))

current = X[0]

ans = 0
for x in X:
    ans += min((x - current) * A, B)
    current = x

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(b, (x[i]-x[i-1]) * a)
print(ans)

Solution (Python):

import math
import itertools
import statistics

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

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

print(total)

Solution (Python):
n,a,b = map(int,input().split())
x = sorted(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())
a=list(map(int,input().split()))
border=B//A+1
ans=0
for i in range(N-1):
  d=a[i+1]-a[i]
  if d>=border:
    ans+=B
  else:
    ans+=(A*d)
print(ans)

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

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):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():
    n,a,b=MI()
    xx=LI()
    now=xx[0]
    ans=0
    for x in xx[1:]:
        if (x-now)*a<b:ans+=(x-now)*a
        else:ans+=b
        now=x
    print(ans)

main()

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

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

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

Solution (Python):

import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n,a,b = map(int,input().split())
X = list(map(int,input().split()))
dis = [0]*(n-1)
for i in range(1,n):
  dis[i-1]= X[i]-X[i-1]
for di in dis:
  if di*a <= b:
    ans += di*a
  else:
    ans += b
print(ans)

Solution (Python):
import sys
input = sys.stdin.readline

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

def main():
    mod=10**9+7
    N,A,B=MI()
    X=LI()
    ans=0
    for i in range(N-1):
        d=X[i+1]-X[i]
        ans+=min(d*A,B)
        
    print(ans)

main()

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

x = list(map(int, input().split())) 

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

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

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

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(1,N):
    ans += min(abs(X[i]-X[i-1])*A,B)
print(ans)

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

ans = 0
for e1, e2 in zip(x, x[1:]):
    walk = (e2 - e1) * a
    ans += min(walk, b)

print(ans)