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)
}

C++: #include <stdio.h>
#include <stdlib.h>

int main(void){
	int a, b, c, d, e;
	int i, total;
	
	scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
	
	total = 0;
	
	for (i = a; i < b; i++){
		if (a < 0){
			total += c;
		}
		else if(a == 0){
			total += d + e;
		}
		else {
			total += e;
		}
		a++;
	}
	
	printf("%d\n", total);
	
	return 0;
}

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

int main() {
	int A, B, C, D, E, i=0, t=0;
	// A=もともとの肉の温度,B=目的の肉の温度
	cin >> A;
	cin >> B;
	cin >> C;
	cin >> D;
	cin >> E;

	for (i = A; i <= B; i++) {
		if (i < 0) {
			t += C;
		}
		else if (i == 0) {
			t += D;
		}
		else if (i > 0) {
			t += E;
		}
	}

	if (A > 0) {
		t -= E;
	}
	cout << t << endl;
	return 0;
}

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

int main(void){
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    int time = 0, temp = a;
    if (a < 0) {
        for (temp = a; temp < 0; temp++) {
            time += c;
            
        }
        temp = 0;
        time += d;
    }
    for(; temp < b; temp++) {
        time += e;
    }
    cout << time << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int A,B,C,D,E;
    cin>>A>>B>>C>>D>>E;
    if(A>0){
        cout<<(B-A)*E<<endl;
    }
    else if(A<0){
        cout<<C*(-A)+D+B*E<<endl;
    }
    
}

C++: #define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;

	int s = 0;

	if (a < 0)
	{
		s += abs(a) * c;

		a = 0;
	}

	if (a >= 0)
	{
		if (a == 0)
		{
			s += d;
		}

		s += (b - a) * e;
	}

	cout << s << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c, d, e, ans;
  cin >> a >> b >> c >> d >> e;
  if (a < 0) {
    a *= -1;
    ans = c * a + d + e * b;
  } else {
    ans = e * (b - a);
  }
  cout << ans << "\n";
}

C++: #include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<cassert>
using namespace std;
int inf = 1000000000;

int main(void) {

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

  return 0;
}


// EOF

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,x,y,n;
	scanf("%d",&a);
	scanf("%d",&b);
	scanf("%d",&c);
	scanf("%d",&d);
	scanf("%d",&e);
	if(a<0){
		y=c*a*(-1);
		n=e*b;
		x=y+d+n;
		printf("%d\n",x);
	}
	else{
		x=e*(b-a);
		printf("%d\n",x);
	}
	
	return 0;
}

C++: #include <iostream>
using namespace std;
int msin(void)
{
	int a,b,c,d,e,f,g,h,i;
	cin>>a>>b>>c>>d>>e;
	f=0;
	if (a<0)
	{
		for (;;)
		{
			a++;
			f=f+c;
			if (a==0)
			{
				f=f+d;
			}
			if (a==b)
			{
				cout<<f<<endl;
				return 0;
			}
			if (a==0)
			{
				break;
			}	
		}
	}
	if (a>0)
	{
		a++;
		f=f+d;
		if (a==b)
		{
			cout<<f<<endl;
		}
	}
	return 0;	
}

C++: #include <bits/stdc++.h>
using namespace std;

int a, b, c, d, e;

int main()
{
  cin >> a >> b >> c >> d >> e;

  int ans = 0;
  if (a < 0){
    ans += (a * c) * -1;
    a = 0;
  }

  if (a == 0){
    ans += d;
  }

  ans += (b - a) * e;

  cout << ans << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main () {
    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;
    
    int sum = 0;
    while (A != B) {
        if (A < 0) {
            sum = -A * C;
            A = 0;
        } else {
            if (A == 0) {
                sum += D;
            }
            sum += (B - A) * E; 
            A = B;
        }
    }
    
    cout << sum << endl;
}

C++: #include <cstdio>
#include <algorithm>
using namespace std;

int main() {
    int a, b, u0, u1, ue, sum;
    scanf("%d %d %d %d %d", &a, &b, &u0, &u1, &ue);
    sum = (a < 0) ? (a*u0* -1)+(u1)+(b*ue) : (b-a) * ue;
    printf("%d\n", sum);
    return 0;
}

C++: #include<stdio.h>
int main()
{
	int a,b,c,d,e;
	scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
	if(a<0&&b<=0){
		printf("%d\n",c*(b-a));
	}else if(a<0&&b>0){
		printf("%d\n",(-a)*c+d+b*e);
	}else{
		printf("%d\n",(b-a)*e);
	}
	return 0;
}

C++: #include<stdio.h>
int main(void)
{
	int a,b,c,d,e,x;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	if(a<0){
		x=(a*-1)+c+(b*e);
	}
	if(a>0){
		x=(b-a)*e;
	}
	printf("%d\n",x);
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
int A,B,C,D,E;
cin>>A>>B>>C>>D>>E;
if(A < 0)
cout<<C + D + E<<endl;
else if(A == 0)
cout<<D + E<<endl;
else if(A > 0)
cout<<E<<endl;
}

C++: 
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <vector>
using namespace std;
int a;
int b;
int c;
int d;
int e;
int f;
int time;
int main(){
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	if (a < 0){
		time += (0 - a)*c;
		a = 0;
	}
	if (a == 0){
		time += d;
		f = 1;
	}
	
	
	if (a >= 0){
		time += (b - a)*e;
	
	}
	
	cout << time << endl;

	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;
    int ans = 0;
    if(A < 0) {
        ans += abs(A) * C + D;
        A = 0;
    }
    ans += (B - A) * E;
    cout << ans << endl;
}

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

int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;

	if (a < 0)
	{
		cout << -a * c + d + b * e << endl;
	}
	else
	{
		cout << (b - a) * e << endl;
	}

	return 0;
}

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

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

  if (A < 0) cout << -1 * A * C + D + B * E << endl;
  else cout << (B - A) * E << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

#define REP(i,n) for(int i=0;i<(n);i++)
#define REAP(i,a,n) for(int i=(a);i<(n);i++)
#define YES cout<<"Yes"<<endl
#define NO cout<<"No"<<endl
#define fr first
#define sc second
#define pb push_back
#define All(v) v.begin(),v.end()
typedef long long ll;

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

C++: 

#include <iostream>
using namespace std;
int main()
{
    int A, B, C, D, E, ans ;
    cin >> A >> B >> C >> D >> E ;
    
    if(A>0){
        ans = (B-A)*E;
        
    }
    else {
        ans = -A * C + D + B * E;
        
    }
    
    
    cout<<ans<<endl;

    return 0;
}

C++: #include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,s=0;
    
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> e;
    
    if(a<0){
        a=-a;
        s=a*c;
        s += d;
        s += b*e;
    }
    else{
        s=(b-a)*e;
    }
    cout << s << endl;
}