Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextInt() (int, error) {
	return strconv.Atoi(nextString())
}

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func main() {
	scanner.Split(bufio.ScanWords)
	startTemp, _ := nextInt()
	targetTemp, _ := nextInt()
	deltaFrozen, _ := nextInt()
	deltaZero, _ := nextInt()
	deltaNotFrozen, _ := nextInt()

	requiredTime := 0

	if startTemp < 0 {
		requiredTime += -startTemp * deltaFrozen
	}
	if startTemp <= 0 {
		requiredTime += deltaZero
	}
	if startTemp <= 0 {
		requiredTime += targetTemp * deltaNotFrozen
	} else {
		requiredTime += (targetTemp - startTemp) * deltaNotFrozen
	}

	fmt.Println(requiredTime)
}

Python: tem = []
for i in range(5):
    tem.append(int(input()))
    
t = 0
if (tem[0]<0):
    t += (0-tem[0])*(tem[2])
    t += tem[3]
    t += tem[1]*(tem[4])
elif (tem[0]>0):
    t += (tem[1] - tem[0])*(tem[4])
print(t)

Python: s=[int(input()) for _ in range(5)]
if s[0]<0:
    print(-s[0]*s[2]+s[3]+s[1]*s[4])
else:
    print((s[1]-s[0])*s[4])

Python: import sys
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
time = 0
if a < 0 and b < 0:
    time += (b - a) * c
    print(time)
    sys.exit()
if b == 0:
    time += (-a) * c + d
    print(time)
    sys.exit()
if b > 0:
    if a < 0:
        time += (-a) * c + d + b * e
        print(time)
    else:
        time += (b - a) * e
        print(time)
        sys.exit()

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())

min=0

if a<0 :
    aa=-1*a
    min+=aa*c+d+b*e
elif a==0 :
    min+=c+b*e
else :
    min+=(b-a)*e

print(min)

Python: import time
s=time.time()
while time.time()-s<39.99:pass
i=input
a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
if a<0:print(c*-a+d+b*e)
else:print((b-a)*e)

Python: A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

if A > 0:
  print((B - A) * E)
if A < 0:
  print((-A * C)+ D + (B * E))

Python: for i in range(5):
  a=int(input())
  b=int(input())
  c=int(input())
  d=int(input())
  e=int(input())
  if a<0:
    x=abs(a)*c+d+b*e
    print(x)
  elif a>=0:
    y=(b-a)*e
    print(y)
  else:
    pass

Python: list1=[]
for i in range(5):
    a=int(input())
    list1.append(a)
    
#print(list1)

if list1[0]<0:
    ans=(0-list1[0])*list1[2]+list1[3]+list1[1]*list1[4]
else:
    ans=(list1[1]-list1[0])*list1[4]
print(ans)

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
  x=-a*c+d+b*e
  print(x)
else :
  y=(b-a)*e
  print(y)

Python: # 入力
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
result=0

# 処理
# 肉が凍っていて，その温度が 0 ℃より小さいとき
if A<0:
    # C 秒で 1 ℃温まる (0秒含む）
    result+=C*-(A)
    # 肉が凍っていて，その温度がちょうど 0 ℃のとき
    result+=D

    result+=B*E
# 肉が凍っていないとき
elif A==0:
    result=+E
    result+=B*E
else:
    result+=(B-A)*E



print(result)

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if a < 0:
    print(abs(a) * c + d + b * e)
elif a == 0:
    print(d + b * e)
else:
    print((b-a) * e)

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
print([(b-a)*e,(-a*c+d+b*e)][a<0])

Python: for i in range(5):
  a=int(input())
  b=int(input())
  c=int(input())
  d=int(input())
  e=int(input())
  if a<0 and a<b:
    x=abs(a)*c+d+b*e
    print(x)
  elif a>0 and a<b:
    y=(b-a)*e
    print(y)
  else:
    pass

Python: a,b,c,d,e=[int(input()) for _ in range(5)]
print(-a*c+d+b*e if a<0 else (b-a)*e)

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
time=(b-a)*e
if a<0:
    time=(-a)*c+d+b*e
print(time)

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if a < 0:
    print(-a*c+d+b*e)
else:
    print((b-a)*e)

Python: to,tt,tf,me,tn=[int(input())for i in range(5)]
if to<0:print(-to*tf+me+tt*tn)
else:print((tt-to)*tn)

Python: a,b,c,d,e=[int(input()) for _ in range(5)]
if a<0:
    print(-a*c+d+b*e)
else:
    print((b-a)*e)

Python: time = 0
a = [int(input()) for i in range(5)]

if a[0] <= 0:
    time = -a[0]*a[2] + a[3] + a[1]*a[4]
else:
    time = (a[1] - a[0])*a[4]

print(time)

Python: import sys
a,b,c,d,e=map(int,sys.stdin.read().split())
if a<=0:
	print(-a*c+d+b*e)
else:
	print((b-a)*e)

Python: # coding: utf-8

A, B, C, D, E = [int(input()) for i in range(5)]

time = 0
if A < 0: time += (min(B, 0) - A)*C
if A*B <= 0: time += D
if B > 0: time += (B - max(A, 0))*E
print(time)

Python: a, b, c, d, e = [int(input()) for _ in range(5)]
if a < 0:
  print(-a * c + d + b * e)
else:
  print((b - a) * e)

Python: a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

if a < 0:
    ans = -a * c + d + b * e
elif a == 0:
    ans = d + b * e
else:
    ans = (b - a) * e

print(ans)

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
time=0
if a<0:
    a=(-1)*a
    time=a*c+d+b*e
elif a==0:
    time=d+b*e
else:
    b=b-a
    time=b*e
print(time)

Python: import time
s=time.time()
while time.time()-s<39.9:pass
i=input
a,b,c,d,e=map(int,[i(),i(),i(),i(),i()])
if a<0:print(c*-a+d+b*e)
else:print((b-a)*e)

Python: a, b, c, d, e = [int(input())for i in range(5)]
t = 0
b += (a<0)
while a!=b:
    if a<0: t+=c
    elif a==0: t+=d
    else: t+=e
    a+=1
print(t)

Python: s, ae= 0, [int(input()) for _ in range(5)]
f = True if ae[0]<0 else False
while ae[0]!= ae[1]:
    if ae[0]< 0:
        s, ae[0]= s+ae[2], ae[0]+1
    elif ae[0]== 0 and f:
        s, f= s+ae[3], False
    else:
        s, ae[0]= s+ae[4], ae[0]+1
print(s)

Python: for i in range(5):
  a=int(input())
  b=int(input())
  c=int(input())
  d=int(input())
  e=int(input())
  if a<0 and a<b:
    x=abs(a)*c+d+b*e
    print(x)
  elif a>0 and a<b:
    y=(b-a)*e
    print(y)
  else:
    break

Python: A,B,C,D,E=[int(input())for i in range(5)]
if A>0:print((B-A)*E)
else:print(C*abs(A)+D+E*B)

Python: mylist=[]

for i in range(5):
    a=int(input())
    mylist.append(a)

if mylist[0]<0:
    print(mylist[0]*mylist[2]*(-1)+mylist[3]+mylist[1]*mylist[4])
else:
    print((mylist[1]-mylist[0])*mylist[4])

Python: A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
time = 0

if A != B:
    if A < 0:
        time += C * (-A)
        time += D
        time += E * B
    if A == 0:
        time += D
        time += E * B
    if A > 0:
        time += E * (B - A)
elif A == B:
    time = B

print(time)

Python: # -*- coding: utf-8 -*-
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if a<0:
    print(-a*c+d+b*e)
else:
    print((b-a)*e)

C++: #include <iostream>
using namespace std;

int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	if(a>0){
		cout<<(b-a)*e<<endl;
	}
	else{
		cout<<b*e+d-a*c<<endl;
	}
	return 0;
}

C++: //Microwave
#include <iostream>

using namespace std;

int main() {
    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;
    int T = 0;

    if(A < 0) {
        T += (0 - A) * C + D + B * E;
    } else {
        T += (B - A) * E;
    }

    cout << T << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int b,c,d,e,t,kooricount,a,C;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    t=0;
    C=a;
    kooricount=0;
    while(1){
        if(C>=b){
            break;
        }
        if(C<0){
            t+=c;
            C++;
        }else if(C==0&&kooricount==0){
            t+=d;
            kooricount++;
        }else{
            t+=e;
            C++;
        }
    }
    cout<<t<<endl;
}