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>
#include <vector>

void solve() {
    int a, b, c, d, e;
    std::cin >> a >> b >> c >> d >> e;

    int ans = 0;
    while (a < b) {
        if (a < 0) {
            ans += c;
        } else {
            ans += e;
            if (a == 0) {
                ans += d;
            }
        }
        ++a;
    }

    std::cout << ans << std::endl;
}

int main() {
    std::cin.tie(nullptr);
    std::cout.tie(nullptr);
    std::ios::sync_with_stdio(false);

    solve();

    return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define BIT(x,n) bitset<n>(x)
#define PI 3.14159265358979323846

typedef long long ll;
typedef pair<string,int> P;
typedef pair<int,P> PP;

//-----------------------------------------------------------------------------

int a,b,c,d,e;

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

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

	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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;
	while(a != b){
		if(a < 0){
			a++; ans += c;
		}else if(a == 0){
			a++;
			ans += d+e;
		}else{
			a++;
			ans += e;
		}
	}

	cout << ans << endl;

	return 0;

}

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

C++: #include<stdio.h>
int main()
{
int A,B,C,D,E,good1,good2,good3,F,G,H;
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
scanf("%d",&D);
scanf("%d",&E);
if(A<0){
G=C*-A;
H=B*E;
good1=G+D+H;
printf("%d\n",good1);
}else{
if(A==0){
good2=D+H;
printf("%d\n",good2);
}else{
F=B-A;
good3=E*F;
printf("%d\n",good3);
}}
return(0);
}

C++: #include<iostream>

using namespace std;

int main(){

	int a,b,c,d,e; 
	cin >> a >> b >> c >> d >> e;
	int answer;


	if(a<0){
		answer=-a*c+e*b+d;
	      }

	if(a>0){
		answer=e*b-e*a;
	}
	cout << answer <<endl;


	return 0;
}

C++: #include <iostream>

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++: // template.cpp {{{
#include <bits/stdc++.h>
using namespace std;

using lint = long long;
#define reps(i, a, n) for (lint i = (a); i < (lint)(n); ++i)
#define rep(i, n) reps(i, 0, n)
struct pre_{pre_(){cin.tie(0);ios::sync_with_stdio(0);}} pre__;
// }}}

signed main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  int res = 0;
  if (a < 0) {
    res += abs(a) * c + d;
    a = 0;
  }

  cout << res + (b - a) * e << endl;
}

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

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

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

C++: #include <iostream>
using namespace std;
int main(void){
    int x, y, z, w, u;
    int time = 0;
    cin >> x >> y >> z >> w >> u;
    if(x < 0){
       x = -x;
       time = x*z + w + y*u;
       cout << time <<endl;
    }
    else{
        time = (y-x)*u;
        cout << time << endl;
    }
}

C++: #include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i <= n; i++)
#define ll long long
using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

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

  i64 ans = 0;
  if(A < 0){
    ans += -A * C;
    A = 0;
  }

  if(A == 0){
    ans += D;
  }

  ans += (B - A) * E;

  cout << ans << endl;
}

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

int A,B,C,D,E;

int main(){
  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++: /*1 行目には，もともとの肉の温度 A が書かれている．
2 行目には，目的の温度 B が書かれている．
3 行目には，凍った肉を 1 ℃温めるのにかかる時間 C が書かれている．
4 行目には，凍った肉を解凍するのにかかる時間 D が書かれている．
5 行目には，凍っていない肉を 1 ℃温めるのにかかる時間 E が書かれている.*/
#include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e;
    cin>>a>>b>>c>>d>>e;
    if(a<=0){
      cout<<0-a*c+d+b*e<<endl;
    }
    else{
        cout<<(b-a)*e<<endl;
    }
}

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

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 (B<0) {
        cout << (B-A)*C << endl;
    } else if (B<0) {
        cout << (-A)*C+D+B*E << endl;
    } else {
        cout << (B-A)*E << endl;
    }
    return 0;
}