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: a, b, c, d, e =[int(input())for i in range(5)]

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

Python: a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if(a>=0):
    print ((b-a)*e);
else:
    print(a*-c+d+b*e);

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

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

t += (b - max(a, 0)) * e

print(t)

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

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

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: 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)
  else:
    y=(b-a)*e
    print(y)

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

t = 0

if A < 0:
    t += C * abs(A) + D

t += E * (B - max(0, A))

print(t)

Python: A, B, C, D, E = map(int, open(0).read().split())
if A < 0:
    if B > 0:
        print(-A*C+D+E*B)
    else:
        print((B-A)*C)
else:
    print((B-A)*E)

Python: int_list = []
for num in range(5):
    inta = int(input())
    int_list.append(inta)
if int_list[0] < 0:
    num1 = int_list[0] * -1
    num2 = num1 * int_list[2]
    num2 += int_list[3]
    num3 = int_list[4] * int_list[1]
    num2 += num3
    print(num2)
elif int_list[0] > 0:
    num1 = int_list[1] - int_list[0]
    num2 = num1 * int_list[4]
    print(num2)

Python: def main():
    v = [int(input()) for _ in 5*[0]]
    ans = 0
    if v[0] < 0:
        ans += abs(v[0]) * v[2]
        v[0] = 0
    if v[0] == 0:
        ans += v[3]
    ans += abs(v[1]-v[0]) * v[4]
    print(ans)
    
if __name__ == "__main__":
    main()

Python: A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
total_time = 0
if A > 0:
    total_time = (B - A) * E
elif A == 0:
    total_time += D
    total_time += B * E
else:
    total_time += -A * C
    total_time += D
    total_time += B *E

print(total_time)

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

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()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e)

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

t = 0

if A < 0:
    t += C * abs(A) + D

t += E * (B - A)

print(t)

Python: # -*- coding: utf-8 -*-
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())

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

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

ans = 0

while A < B:
    flag=True
    if A<0:
        ans += C*(abs(A))
        A+=abs(A)
        flag=False
    elif A==0:
        ans+=D
        flag=True
    if flag:
        ans += E*(B-A)
        A+=(B-A)
print(ans)

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

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

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

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

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

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

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

else:
    print((B-A)*E)

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()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e)

Python: l = [int(input()) for i in range(5)]

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

elif l[0] == 0:
     print(l[3] + l[1] * l[4])

else:
    print((l[1]-l[0]) * l[4])

Python: temp_a, temp_b, temp_c, temp_d, temp_e = [int(input()) for _ in range(5)]

frozen = temp_c * abs(temp_a) 
not_frozen = temp_e * temp_b + temp_d

if temp_a <= 0:
    print(frozen + not_frozen)
else:
    print((temp_b - temp_a) * temp_e)

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

Python: import sys
import math
time=0
a=int(input())
b=int(input())
c=int(input())
d=int(input())
e=int(input())
if(a<0):
    a_temperature=abs(a)
    time=a_temperature*c
    time=time+d
    time=time+b*e
    
if(a>=0):
    if(a==0):
        time=time+d
    time=time+(b-a)*e
print(time)

Python: # AOJ 0630: Microwave
# Python3 2018.7.2 bal4u

a, b, c, d, e = [int(input()) for i in range(5)]
if   a < 0 and b < 0: ans = c*(b-a)
elif a > 0 and b > 0: ans = e*(b-a)
else:                 ans = c*(-a)+d+e*b
print(ans)

Python: # -*- coding: utf-8 -*-
"""
Microwave
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0630

"""
import sys


def solve(a, b, c, d, e):
    ans = 0
    while a < b:
        if a < 0:
            a += 1
            ans += c
        elif a == 0:
            a += 1
            ans += (d + e)
        else:
            a += 1
            ans += e
    return ans


def main(args):
    a = int(input())
    b = int(input())
    c = int(input())
    d = int(input())
    e = int(input())
    ans = solve(a, b, c, d, e)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

if a <= 0:
    t = -a*c
    t = t + d
    a = 0

print(t + (b-a)*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)
  else:
    y=(b-a)*e
    print(y)

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()])
print(c*-a+d+b*e)if a<0 else print((b-a)*e)

Python: def frozen(A, t):
    if A >= B or A >= 0: return A, t
    return frozen(A + 1, t + C)

def normal_temperature(A, t):
    if A >= B: return A, t
    return normal_temperature(A + 1, t + E)

t = 0
A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
# 温度が０℃より低い時、温度を１℃上げるのにかかる時間
if A < 0:
    A, t = frozen(A, t)
# 解凍にかかる時間
if A == 0 and A < B:
    t+=D
# 温度が０℃より高い時、温度を１℃上げるのにかかる時間
if A >= 0:
    A, t = normal_temperature(A, t)

print(t)