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 = list(map(int, input().split(" ")))
X_list = list(map(int, input().split(" ")))

val = 0

for X1, X2 in zip(X_list[:-1], X_list[1:]):
    A_val = A*(X2-X1) 
    if A_val > B:
        val += B
    else:
        val += A_val
print (val)

Solution (Python):


n,a,b=map(int,raw_input().split())
x=map(int,raw_input().split())
res=0
for i in xrange(1,n):
 res+=min((x[i]-x[i-1])*a,b)
print res

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

xi = []
xi.append(inputs[0])
hirou = 0

for i in range(1, N):
    xi.append(inputs[i])
    diff = xi[i] - xi[i-1]
    if diff * A > B:
        hirou += B
    else:
        hirou += A * diff

print(hirou)

Solution (Python):

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


if __name__ == "__main__":
    import sys
    import os
    if len(sys.argv) > 1:
        if sys.argv[1] == "-d":
            filename = "input1.txt"
            fd = os.open(filename, os.O_RDONLY)
            os.dup2(fd, sys.stdin.fileno())
            main()
    else:
        main()

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

    print(ans)

if __name__ == '__main__':
    main()

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

x = map(int, raw_input().strip().split(" "))
result = 0
for i in range(1, n):
	if a * (x[i] - x[i-1]) > b:
		result += b
	else:
		result += a * (x[i] - x[i-1])
print result

Solution (Python):
import sys


cin = sys.stdin

cout = sys.stdout

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

if __name__=="__main__":
    solve()

Solution (Python):
import numpy as n;i=lambda:n.fromstring(input(),dtype=int,sep=' ');N,A,B=i();print(int(sum(n.diff(i()*A).clip(0,B))))

Solution (Python):
import numpy as n;i=lambda:n.fromstring(input(),sep=' ');N,A,B=i();X=n.diff(i())*A;X[X>B]=B;print(int(sum(X)))

Solution (Python):
N, A, B = [int(z) for z in input().split()]
X = [int(z) for z in 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())
x = list(map(int, input().split()))

ans = 0

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

print(ans)

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

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

    print(cost)

__main__()

Solution (Python):
insp = lambda: list(map(int, input().split()))

N, A, B = insp()
X = insp()

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

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

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

print(c)

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

Solution (Python):
import itertools,math,bisect,pprint,sys
n, a, b = map(int, raw_input().split())
x = map(int, raw_input().split())
res = 0
for i in range(n-1):
    c = (x[i+1]-x[i])*a
    if c > b:
        res += b
    else:
        res += c
print res

Solution (Python):
def iter2(it):
    x = iter(it)
    before = next(x)
    for item in x:
        yield before, item
        before = item

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

costs = (min(B, A*(x2-x1)) for x1, x2 in iter2(xs))
print(sum(costs))

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

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

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


def main():
    n,a,b = LI()
    r = 0
    x = LI()

    t = x[0]
    x.sort()
    i = x.index(t)
    if i == n-1 or i == 0:
        for j in range(n-1):
            if (x[j+1] - x[j]) * a < b:
                r += (x[j+1] - x[j]) * a
            else:
                r += b
        return r

    if (x[i+1]-x[0])*a < b:
        r += ((t - x[0]) + (x[i+1] - x[0]))*a
        for j in range(i+2,n):
            if (x[j] - x[j-1]) * a < b:
                r += (x[j] - x[j-1]) * a
            else:
                r += b
        return r
    if (x[-1]-x[i-1])*a < b:
        r += ((x[-1] - t) + (x[-1] - x[i-1]))*a
        for j in range(i-1):
            if (x[j+1] - x[j]) * a < b:
                r += (x[j+1] - x[j]) * a
            else:
                r += b
        return r

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

    return r


print(main())

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

Solution (Python):
n, a, b = map(int, raw_input().split())
x = map(int, raw_input().split())
y = [x[i+1] - x[i] for i in range(n-1)]

ans = 0
for i in y:
    if i*a < b:
        ans += i*a
    else:
        ans += b
print ans

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

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

Solution (Python):
n,a,b=[int(i) for i in input().split()]
x=[int(i) for i in input().split()]
ans=chk=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, raw_input().split())
X = map(int, raw_input().split())

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