CodeEff/ECCO huggingface dataset:
# Original solution
N = int(eval(input()))
numbers = []
for i in range(N):
    numbers.append(int(eval(input())))
    
aaa = max(numbers)
    
for n in numbers:
    if aaa == n:
        print((sorted(numbers)[-2]))
    else:
        print(aaa)

# Optimized solution
N = int(eval(input()))
numbers = []
for i in range(N):
    numbers.append(int(eval(input())))
    
    
aaa = max(numbers)
bbb = sorted(numbers)[-2]

for n in numbers:
    if aaa == n:
        print(bbb)
    else:
        print(aaa)
# Original solution
n = int(eval(input()))
a = [0]*n
c = []

for i in range(0,n):
  a[i] = int(eval(input()))

for i in range(0,n):
  c = a
  temp = c[i]
  c[i] = -1
  print((max(c)))
  c[i] = temp
  
#  1 4 3

# Optimized solution
n = int(eval(input()))
a = [0]*n
c = []

for i in range(0,n):
  a[i] = int(eval(input()))
c = a
m1 = max(a)
m1_ = a.index(m1)
del c[m1_]
m2 = max(c)
m2_ = c.index(m2)

for i in range(0,n):
  if(i == m1_):
    print(m2)
  else:
    print(m1)
# Original solution
n = int(eval(input()))
a = [0]*n
for i in range(n):
    a[i] = int(eval(input()))

for i in range(n):
    b = a[:i]+a[i+1:]
    print((max(b)))


# Optimized solution
n = int(eval(input()))
a = [0]*n
for i in range(n):
    a[i] = int(eval(input()))

b = [0]*n
c = [0]*n
b[0] = a[0]
c[n-1] = a[n-1]
for i in range(1,n):
    b[i]=max(b[i-1],a[i])
    c[n-1-i]=max(c[n-i],a[n-1-i])

for i in range(n):
    if i==0:
        print((c[1]))
    elif i==n-1:
        print((b[n-2]))
    else:
        print((max(b[i-1],c[i+1])))
# Original solution
N=int(eval(input()))
A=[0 for i in range(N)]
for i in range(N):
  A[i]=int(eval(input()))
L=A.copy()
L.sort()
max1=L[N-1]
max2=L[N-2]
for i in range(N):
  if i == A.index(max1):
    print(max2)
  else:
    print(max1)

# Optimized solution
N=int(eval(input()))
A=[0 for i in range(N)]
for i in range(N):
  A[i]=int(eval(input()))
max1=max(A)
numbers_of_max1=0
for i in range(N):
  if A[i]==max1:
    numbers_of_max1+=1
    
if numbers_of_max1>1:
  for i in range(N):
    print(max1)
else:
  L=A.copy()
  L.pop(L.index(max1))
  max2 = max(L)
  for i in range(N):
    if A[i]==max1:
      print(max2)
    else:
      print(max1)
# Original solution
import copy

n = int(eval(input()))

columns = [int(eval(input())) for i in range(n)]

i = 0

while i < n:
    max_value = sorted(set(columns))[-1]
    if max_value == columns[i]:
        tmp = copy.copy(columns)
        del tmp[i]
        print((sorted(set(tmp))[-1]))
    else:
        print(max_value)
    i += 1

# Optimized solution
import copy
n = int(eval(input()))
 
columns = [int(eval(input())) for i in range(n)]

sorted_columns = sorted(columns, reverse = True)

for i in range(n):
    if sorted_columns[0] == columns[i]:
        print((sorted_columns[1]))
    else:
        print((sorted_columns[0]))
# Original solution
n = int(eval(input()))
A = [int(eval(input())) for _ in range(n)]

sorted_A = sorted(A, reverse=True)

for i in range(n):
    if A[i] != sorted_A[0]:
        print((sorted_A[0]))
    else:
        print((sorted_A[1]))

# Optimized solution
n = int(eval(input()))
A = [int(eval(input())) for _ in range(n)]
sort_A = sorted(A, reverse=True)

for a in A:
    if a == sort_A[0]:
        print((sort_A[1]))
    else:
        print((sort_A[0]))
# Original solution


n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
sorted_a = sorted(a)

for i in range(n):
  cal_a = sorted_a.copy()
  cal_a.remove(a[i])
  print((cal_a[-1]))

# Optimized solution


n = int(eval(input()))
a = [int(eval(input())) for i in range(n)]
a_sort = sorted(a)
amax = a_sort[-1]
asmas = a_sort[-2]

for i in range(n):
  if a[i] == amax:
    print(asmas)
  else:
    print(amax)
# Original solution
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    A = [int(eval(input())) for _ in range(N)]
    for i in range(len(A)):
        a = A[:]
        a.pop(i)
        print((max(a)))

if __name__ == '__main__':
    main()

# Optimized solution
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    A = [int(eval(input())) for _ in range(N)]
    max_val = max(A)
    AA = A[:]
    AA.remove(max_val)
    second_max_val = max(AA)
    for a in A:
        if a != max_val:
            print(max_val)
        else:
            print(second_max_val)

if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
a = []
b = 0

for i in range(N):
    a.append(int(eval(input())))

for i in range(N):
    b = a[i]
    a[i] = 0
    print((max(a)))
    a[i] = b


# Optimized solution
N = int(eval(input()))
a = []
b = []
a_max = 0
a_second = 0

for i in range(N):
    a.append(int(eval(input())))

b = a[:]
a.sort(reverse=True)

a_max = a[0]
a_second = a[1]

for i in range(N):
    if b[i] == a_max:
        print(a_second)
    else:
        print(a_max)
# Original solution
N = int(eval(input()))
a = []
b = []
a_max = 0
a_second = 0

for i in range(N):
    a.append(int(eval(input())))

b = a[:]
a.sort(reverse=True)

a_max = a[0]
a_second = a[1]

for i in range(N):
    if b[i] == a_max:
        print(a_second)
    else:
        print(a_max)


# Optimized solution
n=int(eval(input()))
a=[int(eval(input())) for i in range(n)]
l=[0]*n
r=[0]*n
t=0
for i in range(n):
  t=max(t,a[i])
  l[i]=t
t=0
for i in range(n-1,-1,-1):
  t=max(t,a[i])
  r[i]=t
# print(l)
# print(r)
for i in range(n):
  if i==0:
    print((r[i+1]))
    continue
  if i==n-1:
    print((l[i-1]))
    continue
  print((max(r[i+1],l[i-1])))
# Original solution
n = int(eval(input()))
a = [0]
for i in range(n):
  a.append(int(eval(input())))
a.append(0)
for i in range(1,n+1):
  print((max(max(a[:i]),max(a[i+1:]))))

# Optimized solution
n = int(eval(input()))
a = []
for i in range(n):
  a.append(int(eval(input())))
max_1 = max(a)
a[a.index(max_1)] = -1
max_2 = max(a)
a[a.index(-1)] = max_1
for i in range(0,n):
  if a[i] == max_1:
    print(max_2)
  else:
    print(max_1)
# Original solution
n=int(eval(input()))
a=list(int(eval(input())) for i in range(n))
b=[0]
c=[0]
for i in range(n):
    b.append(max(a[:i+1]))
    c.append(max(a[n-i-1:]))
del b[n]
del c[n]

for i in range(n):
    d=b[i]
    e=c[n-1-i]
    print((max(d,e)))

# Optimized solution
n=int(eval(input()))
a=list(int(eval(input())) for i in range(n))
b=[0]
c=[0]
for i in range(n):
    b.append(max(b[i],a[i]))
    c.append(max(c[i],a[-i-1]))
del b[n]
del c[n]
 
for i in range(n):
    d=b[i]
    e=c[n-1-i]
    print((max(d,e)))
# Original solution
n = int(eval(input()))
a = list(map(int, [eval(input()) for i in range(n)]))

maxa=max(a)

for i in range(n):
    if a[i]==maxa:
        list = a[:]
        list.pop(i)
        list.sort(reverse=True)
        print((list[0]))
    else:
        print(maxa)

# Optimized solution
n = int(eval(input()))
a = list(map(int, [eval(input()) for i in range(n)]))

list=a[:]
list.sort(reverse=True)
max1 = list[0]
max2 = list[1]

for i in range(n):
    if a[i]==max1:
        print(max2)
    else:
        print(max1)
# Original solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
a = ["" for _ in range(n)]

for i in range(n):
    a[i] = int(eval(input()))


ans = ["" for _ in range(n)]
for i in range(n):
    a_test = a[:]
    del a_test[i]
    ans[i] = max(a_test)


for i in range(n):
    print((ans[i]))


# Optimized solution
# -*- coding: utf-8 -*-

n = int(eval(input()))
a = [int(eval(input())) for _ in range(n)]

max_a = max(a)
b = a[:]
b.remove(max_a)
max_b = max(b)

if max_a == max_b:
    for i in range(n):
        print(max_a)
else:
    idx = a.index(max_a)
    for i in range(n):
        if idx == i:
            print(max_b)
        else:
            print(max_a)
# Original solution
def resolve():
    N = int(eval(input()))
    A = [int(eval(input())) for i in range(N)]

    mx = max(A)
    for i in range(N):
        s = A[i]
        if mx != s:
            print(mx)
        else:
            print((sorted(A)[-2]))
            
resolve()

# Optimized solution
def resolve():
    N = int(eval(input()))
    A = [int(eval(input())) for i in range(N)]

    mx = max(A)
    sec = sorted(A)[-2]
    for i in range(N):
        s = A[i]
        if mx != s:
            print(mx)
        else:
            print(sec)

resolve()
# Original solution
import sys
sys.setrecursionlimit(210000)
input = sys.stdin.readline

N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
Ad = [0] *N

for i in range(N):
    tmp = A[i]
    A[i] = 0
    print((max(A)))
    A[i] = tmp

# Optimized solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A_reverse = sorted(A)

for i in range(N):
    if A[i] == A_reverse[-1]:
        print((A_reverse[-2]))
    else:
        print((A_reverse[-1]))
# Original solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A_sorted = sorted(A.copy())

for a in A:
    if a == A_sorted[-1]:
        print((A_sorted[-2]))
    else:
        print((A_sorted[-1]))

# Optimized solution
n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]
A2 = sorted(A, reverse = True)

for i in range(n):
    if A[i] == A2[0]:
        print((A2[1]))
    else:
        print((A2[0]))
# Original solution
def main(n: int, a: list):
    for i in range(n):
        t = a.copy()
        t[i] = 0

        print((max(t)))


if __name__ == "__main__":
    n = int(eval(input()))
    a = [int(eval(input())) for _ in range(n)]

    main(n, a)


# Optimized solution
def main(n: int, a: list):
    a_max, a_second = sorted(a, reverse=True)[:2]

    for i in range(n):
        if a[i] != a_max:
            print(a_max)
        else:
            print(a_second)


if __name__ == "__main__":
    n = int(eval(input()))
    a = [int(eval(input())) for _ in range(n)]

    main(n, a)
# Original solution
N = int(eval(input()))
A = []
for i in range(0,N):
  A.append(int(eval(input())))
#print(A)
print((max(A[1:])))
for j in range(1,N-1):
  print((max(A[:j]+A[j+1:])))
print((max(A[:N-1])))

# Optimized solution
N = int(eval(input()))
A = []
for i in range(N):
  A.append(int(eval(input())))
max1 = 0
max2 = 0
for i in range(N):
  if max1 < A[i]:
    max2 = max1
    max1 = A[i]
  elif A[i] > max2:
    max2 = A[i]

for j in range(N):
  if A[j] == max1:
    print(max2)
  else:
    print(max1)
# Original solution
# -*- coding: utf-8 -*-
import copy
def main():
    N = int(eval(input()))
    A = [int(eval(input())) for i in range(N)]
    Ap = copy.copy(A)
    set(Ap)
    Ap.sort(reverse=True)
    Am = max(A)
    for i in range(N):
        if i != A.index(Am) or A.count(Am)>1:
            print(Am)
        else:
            print((Ap[1]))
if __name__ == '__main__':
    main()

# Optimized solution
# -*- coding: utf-8 -*-
import copy
def main():
    N = int(eval(input()))
    A = [int(eval(input())) for i in range(N)]
    Am = max(A)
    if A.count(Am)>1:
        for j in range(N):
            print(Am)
        return
    Ap = copy.copy(A)
    set(Ap)
    Ap.sort(reverse=True)
    for i in range(N):
        if  A[i] != Am:
            print(Am)
        else:
            print((Ap[1]))
if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
A = []
for _ in range(N):
    A.append(int(eval(input())))
list = A
list = sorted(list)
max = list[-1]
second_max = list[-2]
for i in range(N):
    if A[i] == max and A.count(max) == 1:
        print(second_max)
    else:
        print(max)

# Optimized solution
N = int(eval(input()))
A = []
for _ in range(N):
    A.append(int(eval(input())))
list = A
list = sorted(list)
max = list[-1]
second_max = list[-2]
cnt = A.count(max)
for i in range(N):
    if A[i] == max and  cnt == 1:
        print(second_max)
    else:
        print(max)
# Original solution
n=int(eval(input()))
a=[eval(input()) for i in range(n)]

for x in range(len(a)):
    if x==a.index(max(a)):
            print((sorted(a)[-2]))
    else:
            print((max(a)))


# Optimized solution
n=int(input())
a=[int(input()) for i in range(n)]
Max=max(a)
Second=sorted(a)[-2]
Index=a.index(Second)
[print(Max) if i!=Max else print(Second) for i in a]
# Original solution
n = int(eval(input()))
a = []
while True:
  try:
    a.append(int(eval(input())))
  except:
    break

for i in range(n):
  tmp = a[i]
  a[i]=0
  print((max(a)))
  a[i]=tmp

# Optimized solution
n = int(eval(input()))
a = []
while True:
  try:
    a.append(int(eval(input())))
  except:
    break

A = sorted(a,reverse=True)

MAX = A[0]
SMAX = A[1]

for i in range(n):
  if a[i]==MAX:
    print(SMAX)
  else:
    print(MAX)
# Original solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A1 = sorted(A,reverse=True)
for i in range (0,N):
  if A[i] == max(A):
    print((A1[1]))
  else:
    print((A1[0]))

# Optimized solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
A1 = sorted(A,reverse=True)
for i in range (0,N):
  if A[i] == A1[0]:
    print((A1[1]))
  else:
    print((A1[0]))
# Original solution
import sys
input = sys.stdin.readline

def main():
    N = int(eval(input()))
    A = [int(eval(input())) for i in range(N)]

    temp = 0
    minimum = -1
    for i in range(N):
        temp = A[i]
        A[i] = minimum
        print((max(A)))
        A[i] = temp


if __name__ == '__main__':
    main()


# Optimized solution
def main():
    N = int(eval(input()))
    A = [int(eval(input())) for _ in range(N)]

    A_sorted = sorted(A)

    for i in range(N):
        if A_sorted[-1] == A[i]:
            print((A_sorted[-2]))
        else:
            print((A_sorted[-1]))


if __name__ == '__main__':
    main()
# Original solution
N = int(eval(input()))
L = []
for l in range(N):
	L.append(int(eval(input())))

maxL = max(L)
subL = L
num = ["n"] * N

if L.count(maxL) >= 2:
	for i in range(N):
		print(maxL)
		
else:
	for i in range(N):
		if L[i] == maxL:
			num[i] = i
			L[i] = 0
	
	if max(L) != 0:
		secL = max(L)
	else:
		secL = max(subL)
	
	for i in range(N):
		if i in num:
			print(secL)
		else:
			print(maxL)



# Optimized solution
N = int(eval(input()))
L = []
for l in range(N):
	L.append(int(eval(input())))

maxL = max(L)
subL = L
num = ["n"] * N

if L.count(maxL) >= 2:
	for i in range(N):
		print(maxL)
		
else:	
	for i in range(N):
		if L[i] == maxL:
			L[i] = 0
			print((max(L)))
		else:
			print(maxL)
# Original solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
for i in range(N):
    tmp = A[i]
    A[i] = 0
    print((max(A)))
    A[i] = tmp

# Optimized solution
N = int(eval(input()))
A = [int(eval(input())) for i in range(N)]
maximum = max(A)
if A.count(maximum) != 1:
    for i in range(N):
        print(maximum)
else:
    B = A[:]
    B.remove(maximum)
    maximum_ne = max(B)
    for i in range(N):
        if A[i] == maximum:
            print(maximum_ne)
        else:
            print(maximum)
# Original solution
n = int(eval(input()))
a = [int(eval(input())) for _ in range(n)]
for i in range(n):
    print((max(a[:i]+a[i+1:])))

# Optimized solution
n = int(eval(input()))
a = [int(eval(input())) for _ in range(n)]
idx = a.index(max(a))
a.sort()
for i in range(n):
    if i==idx:
        print((a[-2]))
    else:
        print((a[-1]))
# Original solution
import copy
N=int(eval(input()))
A=[int(eval(input())) for _ in range(N)]
l=[]
for i in range(N):
    Ad = copy.deepcopy(A)
    del Ad[i]
    Ad.sort(reverse=True)
    print((Ad[0]))


# Optimized solution
import copy
N=int(eval(input()))
A=[int(eval(input())) for _ in range(N)]
l=[]
for i in range(N):
    l.append([A[i],i])
l.sort(key=lambda x:x[0],reverse=True)
#print(l)
excep=l[0][1]

for i in range(N):
    if i==excep:
        print((l[1][0]))
    else:
        print((l[0][0]))
# Original solution
N = int(eval(input()))
a = [0]*N
for i in range(N):
    a[i] = int(eval(input()))
    
for j in range(N):
    num = a.pop(j)
    print((max(a)))
    a.insert(j, num)

# Optimized solution
N = int(eval(input()))
a = [0]*N
for i in range(N):
    a[i] = int(eval(input()))
b = sorted(a)   

for i in range(N):
    if(a[i] == b[N-1]):
        print((b[N-2]))
    else:
        print((b[N-1]))
# Original solution
N = int(eval(input()))
A = tuple(int(eval(input())) for i in range(N))

B = list(A)

for j in range(N):
    B.pop(j)
    print((max(B)))
    B = list(A)

# Optimized solution
N = int(eval(input()))
A = list(int(eval(input())) for i in range(N))

max_value = max(A)
number = A.count(max_value)

if number > 1:
    for j in range(N):
        print(max_value)
else:
    position = A.index(max_value)
    A.remove(max_value)
    for j in range(N):
        if j == position:
            print((max(A)))
        else:
            print(max_value)
# Original solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import itertools as ite
import math
import random
import sys
import codecs
from collections import defaultdict

INF = 10 ** 18
MOD = 10 ** 9 + 7

sys.setrecursionlimit(1000000)

N = eval(input())
A = [eval(input()) for i in range(N)]
maxA = max(A)
if A.count(maxA) > 1:
    for i in range(N):
        print(maxA)
else:
    for i in range(N):
        if A[i] == maxA:
            print(max(A[:i] + A[i + 1:]))
        else:
            print(max(A))


# Optimized solution
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import itertools as ite
import math
import random
import sys
import codecs
from collections import defaultdict

INF = 10 ** 18
MOD = 10 ** 9 + 7

sys.setrecursionlimit(1000000)

N = eval(input())
A = [eval(input()) for i in range(N)]
maxA = max(A)
if A.count(maxA) > 1:
    for i in range(N):
        print(maxA)
else:
    for i in range(N):
        if A[i] == maxA:
            print(max(A[:i] + A[i + 1:]))
        else:
            print(maxA)
# Original solution
N = int(eval(input()))
A = []
for n in range(N):
    A.append(int(eval(input())))
B = [A[0]]
for n in range(N-1):
    B = B+[max(B[-1], A[n + 1])]
C = [A[-1]]
for n in range(N - 1):
    C = [max(C[0], A[-n - 2])] + C
for n in range(N):
    if n == 0:
        print((C[1]))
    elif n == N - 1:
        print((B[N - 2]))
    else:
        print((max(B[n-1], C[n+1])))


# Optimized solution
N = int(eval(input()))
A = []
for n in range(N):
    A.append(int(eval(input())))
B = [0 for n in range(N)]
B[0] = A[0]
for n in range(N-1):
    B[n+1] = max(B[n], A[n + 1])
C = [0 for n in range(N)]
C[-1] = A[-1]
for n in range(N - 1):
    C[-n-2] = max(C[-n-1], A[-n - 2])
for n in range(N):
    if n == 0:
        print((C[1]))
    elif n == N - 1:
        print((B[N - 2]))
    else:
        print((max(B[n-1], C[n+1])))
# Original solution
N = int(eval(input()))
A = []
for n in range(N):
    A.append(int(eval(input())))
B = [0 for n in range(N)]
B[0] = A[0]
for n in range(N-1):
    B[n+1] = max(B[n], A[n + 1])
C = [0 for n in range(N)]
C[-1] = A[-1]
for n in range(N - 1):
    C[-n-2] = max(C[-n-1], A[-n - 2])
for n in range(N):
    if n == 0:
        print((C[1]))
    elif n == N - 1:
        print((B[N - 2]))
    else:
        print((max(B[n-1], C[n+1])))


# Optimized solution
n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]

l = 0
L = [l]
for a in A:
    l = max(l, a)
    L.append(l)

r = 0
R = [r]
for a in A[::-1]:
    r = max(r, a)
    R.append(r)
R.reverse()

for i in range(n):
    print((max(L[i], R[i+1])))
# Original solution
n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]

l = 0
L = [l]
for a in A:
    l = max(l, a)
    L.append(l)

r = 0
R = [r]
for a in A[::-1]:
    r = max(r, a)
    R.append(r)
R.reverse()

for i in range(n):
    print((max(L[i], R[i+1])))


# Optimized solution
n = int(eval(input()))
A = [int(eval(input())) for i in range(n)]
A_ = sorted(A, reverse=True)
a0, a1 = A_[0], A_[1]
for a in A:
    if a == a0:
        print(a1)
    else:
        print(a0)
# Original solution
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+=a*(X[i+1]-X[i])
    else:
        ans+=b
print(ans)

# Optimized solution
n,a,b=list(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)
# Original solution
N, A, B = list(map(int, input().split()))
City = list(map(int, input().split()))
d = B //A

ans = 0
for x, y in zip(City, City[1:]):
    if y - x <= d:
        ans += (y - x) * A
    else:
        ans += B
print(ans)

# Optimized solution
N, A, B = list(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)
# Original solution
# ARC067D - Walk and Teleport (ABC052D)
def main():
    # choose A * dist[i, j] or B
    N, A, B = tuple(map(int, input().split()))
    X = tuple(map(int, input().split()))
    D = [j - i for i, j in zip(X, X[1:])]  # distance
    ans = sum(min(A * d, B) for d in D)
    print(ans)


if __name__ == "__main__":
    main()

# Optimized solution
# ARC067D - Walk and Teleport (ABC052D)
def main():
    # choose A * dist(i, j) or B greedily
    N, A, B = tuple(map(int, input().split()))
    X = tuple(map(int, input().split()))
    ans = sum(min(A * (j - i), B) for i, j in zip(X, X[1:]))
    print(ans)


if __name__ == "__main__":
    main()
# Original solution
n, a, b = list(map(int, input().split()))
l = list(map(int, input().split()))
ans = 0
for i in range(n-1):
  if (l[i+1]-l[i])*a <= b:
    ans += (l[i+1]-l[i])*a
  else:
    ans += b
print(ans)

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


# Optimized solution
n, a, b = list(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)
# Original solution
N, A, B = list(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)

# Optimized solution
N, A, B = list(map(int, input().split(" ")))
X = list(map(int, input().split(" ")))
print((sum([min(A * (X[i + 1] - X[i]), B) for i in range(N - 1)])))
# Original solution
class UnionFind():
   # 作りたい要素数nで初期化
   # 使用するインスタンス変数の初期化
   def __init__(self, n):
       self.n = n
       # root[x]<0ならそのノードが根かつその値が木の要素数
       # rootノードでその木の要素数を記録する
       self.root = [-1]*(n+1)
       # 木をくっつける時にアンバランスにならないように調整する
       self.rnk = [0]*(n+1)
   # ノードxのrootノードを見つける
   def Find_Root(self, x):
       if(self.root[x] < 0):
           return x
       else:
           # ここで代入しておくことで、後の繰り返しを避ける
           self.root[x] = self.Find_Root(self.root[x])
           return self.root[x]
   # 木の併合、入力は併合したい各ノード
   def Unite(self, x, y):
       # 入力ノードのrootノードを見つける
       x = self.Find_Root(x)
       y = self.Find_Root(y)
       # すでに同じ木に属していた場合
       if(x == y):
           return
       # 違う木に属していた場合rnkを見てくっつける方を決める
       elif(self.rnk[x] > self.rnk[y]):
           self.root[x] += self.root[y]
           self.root[y] = x
       else:
           self.root[y] += self.root[x]
           self.root[x] = y
           # rnkが同じ（深さに差がない場合）は1増やす
           if(self.rnk[x] == self.rnk[y]):
               self.rnk[y] += 1
   # xとyが同じグループに属するか判断
   def isSameGroup(self, x, y):
       return self.Find_Root(x) == self.Find_Root(y)
   # ノードxが属する木のサイズを返す
   def Count(self, x):
       return -self.root[self.Find_Root(x)]
n,a,b=list(map(int,input().split()))
x=list(map(int,input().split()))
h=UnionFind(n)
d=[0]*(2*n-2)
for i in range(n-1):
    d[i]=[i,i+1,min(b,a*(x[i+1]-x[i]))]
    d[i+n-1]=[i,n-1,b]
d.sort(key=lambda x:x[2])
cnt = 0
for i in d:
    if not h.isSameGroup(i[0],i[1]):
        h.Unite(i[0],i[1])
        cnt += i[2]
print(cnt)

# Optimized solution
n,a,b=list(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)