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):
n, a, b = map(int,input().split())
x = list(map(int,input().split()))

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

print(dp[-1])

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

ans = sum([min((xs[i] - xs[i - 1]) * a, b) for i in range(1, n)])
print(ans)

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

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

Solution (Python):
import sys

input_methods=['clipboard','file','key']
using_method=0
input_method=input_methods[using_method]

tin=lambda : map(int, input().split())
lin=lambda : list(tin())
mod=1000000007



def main():
	
	n, a, b = tin()
	
	al=lin()
	pos=al[0]
	ret=0
	for np in al[1:]:
		ret += min(b, (np-pos)*a)
		pos = np
	return ret
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)
		
def input_clipboard():
	import clipboard
	input_text=clipboard.get()
	input_l=input_text.splitlines()
	for l in input_l:
		yield l

if __name__ == "__main__":
	if sys.platform =='ios':
		if input_method==input_methods[0]:
			ic=input_clipboard()
			input = lambda : ic.__next__()
		elif input_method==input_methods[1]:
			sys.stdin=open('inputFile.txt')
		else:
			pass
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

Solution (Python):
import sys



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


def input_int():
    return int(input())


def input_int_list():
    return [int(i) for i in input().split()]


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

    print(dp[n - 1])
    return


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    N, A, B = map(int, input().split())
    X = list(map(int, input().split()))
    dp = [float('inf')] * (N + 5)
    dp[0] = 0
    for i in range(1,N):
        dp[i] = dp[i-1] + min((X[i] - X[i-1]) * A, B)

    print(dp[N-1])

if __name__ == "__main__":
    main()

Solution (Python):

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

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


if __name__ == "__main__":
    resolve()

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

ans = 0
for i in range(len(x)-1):
  walk_cost = a * (x[i+1]-x[i])
  if b < walk_cost:
    ans += b
  else:
    ans += walk_cost
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):
  
  toho = a * (x[i] - x[i-1])
  tele = b
  ans += min(toho, tele)
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):
    costa=(x[i+1]-x[i])*a
    ans+=min(b,costa)
print(ans)

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

now = X[0]
ans = 0
for x in X:
    dis = x - now
    tmp= min(A*dis , B)
    
    ans += tmp
    now = x

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

dist = []
for i in range(n-1):
    dist.append(X[i+1]-X[i])
    
ans = 0
for d in dist:
    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()))
NewX = []
for i in range(N-1):
  NewX.append((X[i+1]-X[i])*A)
ans = 0
for i in NewX:
  ans+=min(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): ans+=min((x[i]-x[i-1])*a, b)
print(ans)

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

cnt = 0

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

print(cnt)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)

def int1(x): return int(x) - 1
def II(): return int(input())
def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())
def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def MS(): return input().split()
def LS(): return list(input())
def LLS(rows_number): return [LS() for _ in range(rows_number)]
def printlist(lst, k=' '): print(k.join(list(map(str, lst))))
INF = float('inf')







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

if __name__ == '__main__':
    solve()

Solution (Python):
import sys
from sys import exit
from collections import deque
from copy import deepcopy
from bisect import bisect_left, bisect_right, insort_left, insort_right
from heapq import heapify, heappop, heappush
from itertools import product, permutations, combinations, combinations_with_replacement
from functools import reduce
from math import gcd, sin, cos, tan, asin, acos, atan, degrees, radians

sys.setrecursionlimit(10**6)
INF = 10**20
eps = 1.0e-20
MOD = 10**9+7

def lcm(x,y):
    return x*y//gcd(x,y)
def lgcd(l):
    return reduce(gcd,l)
def llcm(l):
    return reduce(lcm,l)
def powmod(n,i,mod):
    return pow(n,mod-1+i,mod) if i<0 else pow(n,i,mod)
def div2(x):
    return x.bit_length()
def div10(x):
    return len(str(x))-(x==0)
def intput():
    return int(input())
def mint():
    return map(int,input().split())
def lint():
    return list(map(int,input().split()))
def ilint():
    return int(input()), list(map(int,input().split()))
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])
def lprint(l, sep='\n'):
    for x in l:
        print(x, end=sep)
def ston(c, c0='a'):
    return ord(c)-ord(c0)
def ntos(x, c0='a'):
    return chr(x+ord(c0))
class counter(dict):
    def __init__(self, *args):
        super().__init__(args)
    def add(self,x,d=1):
        self.setdefault(x,0)
        self[x] += d
    def list(self):
        l = []
        for k in self:
            l.extend([k]*self[k])
        return l
class comb():
    def __init__(self, n, mod=None):
        self.l = [1]
        self.n = n
        self.mod = mod
    def get(self,k):
        l,n,mod = self.l, self.n, self.mod
        k = n-k if k>n//2 else k
        while len(l)<=k:
            i = len(l)
            l.append(l[i-1]*(n+1-i)//i if mod==None else (l[i-1]*(n+1-i)*powmod(i,-1,mod))%mod)
        return l[k]
def pf(x,mode='counter'):
    C = counter()
    p = 2
    while x>1:
        k = 0
        while x%p==0:
            x //= p
            k += 1
        if k>0:
            C.add(p,k)
        p = p+2-(p==2) if p*p<x else x
    if mode=='counter':
        return C
    S = set([1])
    for k in C:
        T = deepcopy(S)
        for x in T:
            for i in range(1,C[k]+1):
                S.add(x*(k**i))
    if mode=='set':
        return S
    if mode=='list':
        return sorted(list(S))

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

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

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

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

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect














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


from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n,a,b = readInts()
X = readInts()
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()))
Y = [X[i+1]-X[i] for i in range(n-1)]
ans = 0
for y in Y:
    if y*a <= b:
        ans += y*a
    else:
        ans += b
print(ans)

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


N, A, B = LI()
X = LI()
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()))
sx = sorted(X)
ans = 0
for i in range(N-1):
  d = sx[i+1]-sx[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 = 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 = (X[-1] - X[0]) * A
for x1, x2 in zip(X, X[1:]):
    if (x2 - x1) * A > B:
        ans -= (x2 - x1) * A - B
print(ans)

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

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

Solution (Python):
n, a, b, *x = map(int, open(0).read().split())

now = x[0]

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

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

Solution (Python):






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





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

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

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

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

Solution (Python):



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

ret = 0

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

print(ret)

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

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


def read():
    N, A, B = map(int, input().strip().split())
    X = list(map(int, input().strip().split()))
    return N, A, B, X


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


if __name__ == '__main__':
    inputs = read()
    outputs = solve(*inputs)
    if outputs is not None:
        print("%s" % str(outputs))

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

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


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

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

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

print(res)

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

vals = [float('inf')]*n
vals[0] = 0

c = queue.Queue()
c.put(1)

while not c.empty():
    d = c.get()
    if d == n:
        continue
    if b+vals[d-1] < vals[d]:
        vals[d] = b+vals[d-1]
    if a*(x[d]-x[d-1])+vals[d-1] < vals[d]:
        vals[d] = a*(x[d]-x[d-1])+vals[d-1]
    c.put(d+1)
print(vals[-1])

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

pin=lst[0]
ans=0

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

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

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

cost = 0
now = X[0]

for i in range(N):
    next = X[i]

    cost += min(A*(next-now),B)

    now = next

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):
    d = x[i + 1] - x[i]

    if a * d >= b:
        ans += b
    else:
        ans += a * d

print(ans)

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, A, B = map(int, readline().split())
    X = list(map(int, readline().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()))

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

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

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

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

print(ans)

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

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

res = 0
tmp_i = X_list[0]
for x in X_list:
    a_fatigue = A * (x - tmp_i)
    b_fatigue = B
    tmp_fatigue = min(a_fatigue, b_fatigue)
    res += tmp_fatigue
    tmp_i = x
print(res)

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

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

Solution (Python):
import sys,math,collections,itertools
input = sys.stdin.readline

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

Solution (Python):
import sys,math,collections,itertools
input = sys.stdin.readline

N,A,B = list(map(int,input().split()))
X = sorted(list(map(int,input().split())))
cnt=0
for i in range(N-1):
    if X[i+1]-X[i] >B/A:
        cnt+=B
    else:
        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):
    dist = X[i] - X[i-1]
    if A*dist > B:
        ans += B
    else:
        ans += A*dist

print(ans)

Solution (Python):

import sys


def solve(N: int, A: int, B: int, X: "List[int]"):
    return sum(min(A*(a1-a0), B) for a0, a1 in zip(X, X[1:]))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    A = int(next(tokens))  
    B = int(next(tokens))  
    X = [int(next(tokens)) for _ in range(N)]  
    print(solve(N, A, B, X))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    
    main()

Solution (Python):
def main():
    import sys

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

    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)

    
if __name__ == '__main__':
    main()

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

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

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


if __name__ == "__main__":
    main()

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

Solution (Python):
n,a,b,*x=map(int,open(0).read().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):
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    n, a, b = map(int, readline().rstrip().split())
    x = list(map(int, readline().rstrip().split()))
    sumX = 0
    for i in range(n-1):
        sumX += min(b, a * (x[i + 1] - x[i]))
    print(sumX)


if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, A, B = LI()
    X = LI()

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

    print(ans)

if __name__ == '__main__':
    resolve()

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

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


for i in range(len(xx)):
    if xx[i]<b:
        ans+=xx[i]
    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):
    if (x[i+1]-x[i])*a<b:
        ans+=(x[i+1]-x[i])*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(a * (x[i+1]-x[i]), b)

print(ans)

Solution (Python):
from math import ceil,floor,factorial,gcd,sqrt,log2,cos,sin,tan,acos,asin,atan,degrees,radians,pi,inf
from itertools import accumulate,groupby,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heapify,heappop,heappush
from queue import Queue,LifoQueue,PriorityQueue
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

n, a, b = MAP()
x = LIST()
ans = 0

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

print(ans)

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

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 += a*(X[i+1]-X[i])
    else:
        ans += b
print(ans)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












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

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,a,b = readInts()
X = readInts()
cnt = 0
for i in range(n-1):
    cnt += min((X[i+1]-X[i]) * a, b)
print(cnt)

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

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


now = X[0]
ans = 0
for x in X[1:]:
    if abs(now-x)*a < b: ans += abs(now-x)*a
    else: ans += b
    now = x
print(ans)

Solution (Python):
import sys

input = sys.stdin.readline


def main():
    N, A, B = map(int, input().split())
    X = tuple(map(int, input().split()))

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

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
import numpy
N, A, B = map(int, input().split())
X = numpy.array(list(map(int, input().split())))
D = numpy.diff(X) * A
D[D > B] = B
print(sum(D))

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


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


def main():
    n, a, b = map(int, input().rstrip().split())
    x = list(map(int, input().rstrip().split()))
    ans = 0
    for diff in np.diff(x):
        if diff * a < b:
            ans += diff * a
        else:
            ans += 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(1,n):
    ans += min((X[i]-X[i-1])*a, b)
print(ans)

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

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

print(cost)

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

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

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

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

print(ans)

Solution (Python):


import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
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):

from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

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

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

if __name__ == "__main__":
    main()

Solution (Python):


import sys
read = sys.stdin.read
readline = sys.stdin.readline

n,a,b,*x = map(int,read().split())


d = [i-j for i,j in zip(x[1:],x)]



ans = 0
for i in d:
    ans += min(i*a,b)

print(ans)

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

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

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

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

Solution (Python):
def resolve():
    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 += b
        else:
            ans += walk
    print(ans)
resolve()

Solution (Python):
(n, a, b), xx = [list(map(int, s.split())) for s in open(0)]

suc = xx.pop()

dx = []

while len(xx):
    prec = xx.pop()
    dx.append(suc-prec)
    suc = prec

dx = [min(d*a, b) for d in dx]

print(sum(dx))

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

ds = [0] * (n+10)
for i in range(n-1):
    cost1 = a*(Xs[i+1] - Xs[i])
    cost2 = b
    ds[i+1] = ds[i] + min(cost1, cost2)
print(ds[n-1])

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

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

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

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

print(ans)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

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

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

print(fatigue)