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<iostream>

using namespace std;

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

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

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A, B, C, D, E; //もともとの肉の温度 ,目的の温度 ,凍った肉を 1 ℃温めるのにかかる時間 ,凍った肉を解凍するのにかかる時間,凍っていない肉を 1 ℃温めるのにかかる時間
    cin >> A >> B >> C >> D >> E;
    int x;
    if(A < 0){
        x = (0 - A) * C + D + B * E;
    }
    else if (A > 0){
        x = (B - A) * E;
    }
    else{
        x = D + B * E;
    }
    cout << x << 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 << C*(0-A)+D+E*B << endl;
}
else if(A>0){
	cout << E*(B-A) << endl;
}
return 0;
}

C++: #include <stdio.h>
int main(void)
{
	int a,b,c,d,e,f,g,h,u;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	f=0;
	if (a<=0)
	{
		for (;;)
		{
			if (a<0)
			{
				a=a+1;
				f=f+c;
			}
			else if (a>=0)
			{
				a=a+1;
				f=f+e;
				if (a==b)
				{
					break;
				}
			}
		}
		f=f+d;
		printf("%d\n",f);
		return 0;
	}
	else if (a>0&&a!=b)
	{
		for (;;)
		{
			a=a+1;
			f=f+e;
			if (a==b)
			{
				printf("%d\n",&f);
				break;
			}
		}
	}
	return 0;
}

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*e+d-(a*c)<<endl;
    }
    else{
        cout<<b*e-a*e<<endl;
    }
}

C++: #include<iostream>
#include<cmath>
using namespace std;
int main(){
    
    
    int a,b,c,d,e,x,y,z,h,j,k;
    
    cin>>a>>b>>c>>d>>e;
    
    
    
    x=abs(a);
    y=x*c;
    
    h=b-a;
    j=h*e;
    z=b*e;
    
    if(a<0){
        k=y+d+z;
        cout<<k<<endl;
    }
        else if(a>0){
        cout<<j<<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,s=0,sa=0;
	cin>>a>>b>>c>>d>>e;
	if(a<0){
		a=a*-1;
		s=a*c;
		sa=b;
		s=s+d;
	}
	else sa=b-a;
	s=s+e*sa;
	cout<<s<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const ll INF=1e18;
const ll MOD=1e9+7;
const double pi=acos(-1);
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);  
  
  int a,b,c,d,e;
  cin >> a >> b >> c >> d >> e;
  int ans=0;
  if(a<0){
    ans+=(0-a)*c+d;
    ans+=b*e;
  }
  else if(a==0){
    ans+=ans+=(b-a)*e+d;
  }
  else{
    ans+=(b-a)*e;
  }
  
  cout << ans << endl;
}

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

int main()
{
  int a,b;
  int c,d,e;
  int time,temp;

  cin >> a >> b >> c >> d >> e;

  if(a >0)
    {
      time = b-a;
      
      cout << e*time << endl;
    }
  else
    {
      temp = c*(0-a)+ d + e*b;
      cout << temp << 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 << (-a)*c+d+b*e << endl;
    }
    if(a == 0){
        cout << d+b*e << endl;
    }
    if(a > 0){
        cout << (b-a)*e << endl;
    }
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
const ll mod = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (a < b) {
    ll tmp = a;
    a = b;
    b = tmp;
  }
  ll r = a%b;
  while(r != 0) {
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}

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

C++: //============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;

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

    if( a<0)f=d+e*b+(-a)*c;


    if(a==0)f=d+e*b;


    if( a>0)f=(b-a)*e;

    cout<<f<<endl;
}

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

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

    cout << ans << '\n';
    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==b)
			{
				cout<<f<<endl;
				return 0;
			}
			if (a<=0)
			{
				break;
			}
		}
	}
	if (a==0)
	{
		f=f+c;
	}
	if (a>0)
	{
		a++;
		f=f+d;
		if (a==b)
		{
			cout<<f<<endl;
		}
	}
	return 0;	
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e,sum;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	if(a<0){
		sum=-a*c+d+b*e;
	}else if(a=0){
		sum=d+b*e;
	}else if(a>0){
		sum=(b-a)*e;
	}
	cout << sum << endl;
}

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

int main() {
  int A;
  cin >> A;
  int B;
  cin >> B;
  int C;
  cin >> C;
  int D;
  cin >> D;
  int E;
  cin >> E;
  //input data
  int s = 0;
  if( B <= 0) {
    if(A < 0) s += C * ((A - B) * -1);
  }else if( B > 0) {
    if(A < 0){
       s += C * (A * -1);
       A = 0;
    }
    if(A == 0) s += D;
    if(A >= 0) s += E * (B - A);
  }
  cout << s << endl;
}