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<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;


int a, b, c, d, e, total;

int main(){

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

	if (a < 0) {
		total += abs(a) * c;
		a = 0;
	}
	if (a == 0)total += d;

	total += e * (b - a);

	cout << total << 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;
  if(a < 0) ans = -a *c + d + b * e;
  if(a > 0)  ans = (b-a)*e;
  cout<<ans<<endl;

  return 0;
  }

C++: #include <bits/stdc++.h>
using namespace std;
#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 fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> pip;
const ll INF = 1e9+100;
const ll MOD = 1e9+7;
const double EPS = 1e-10;
const bool debug = 0;
//------------------------------//

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

C++: #include <iostream>
#include <cstdio>

using namespace std;

class microwave
{
  int tmpA, tmpB;
  int timeC, timeD, timeE;

public:
  microwave(int a, int b, int c, int d, int e) 
    : tmpA(a),tmpB(b),timeC(c),timeD(d),timeE(e) {}
  int calcTime();
};

int microwave::calcTime()
{
  int time = 0;
  if (tmpA < 0)
  {
    time += (-1) * tmpA * timeC;
    time += timeD;
    time += tmpB * timeE;
  }
  else if (0 < tmpA)
  {
    time += (tmpB - tmpA) * timeE;
  }
  return time;
}

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

  scanf("%d", &a);
  scanf("%d", &b);
  scanf("%d", &c);
  scanf("%d", &d);
  scanf("%d", &e);

  microwave mcr(a, b, c, d, e);

  printf("%d\n", mcr.calcTime());
  
  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 + D + B * E;
	}

	if (A > 0){
		answer = (B -A) * E;
	}

	cout << answer << endl;


		

}

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

C++: #include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <string.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
using namespace std;

int main(){
	int a,b,c,d,e;
	cin >> a >> b >> c >> d >> e;
	if(a > 0){
		printf("%d\n",e*(b-a));
	}
	else{
		printf("%d\n",e*b+d-c*a);
	}
	
	
	return 0;
}

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

C++: #include <iostream>
using namespace std;
int main(){
    int a[5];
    int ans=0;
    
    for(int i=0;i<5;i++){
        cin>>a[i];
    }
    
    if(a[0]<0){
        a[0]=-1*a[0];
        ans+=a[0]*a[2];
        ans+=a[3];
        ans+=a[1]*a[4];
    }
    
    else{
        ans+=(a[1]-a[0])*a[4];
    }
    cout<<ans<<endl;
    
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e,x,y,i,j,p,ans1=0,ans2=0;
    cin>>a>>b>>c>>d>>e;
    if(a<=0){
    x=0-a;
    for(i=1;i<=x;i++){
        ans1=ans1+c;
            }
            ans1=ans1+d;
            for(j=1;j<=b;j++){
                ans1=ans1+e;
            }
            cout<<ans1<<endl;
    }
    else if(a>0){
        x=b-a;
        for(p=0;p<x;p++){
            ans2=ans2+e;
        }
        cout<<ans2<<endl;
            }
    
return 0;
    
}

C++: #include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B, C, D, E, x;
  cin>>A>>B>>C>>D>>E;
  if (A < 0){
    x=-1*A *C + D + E*B ;
    cout<<x<<endl;
  }
  else if(A > 0){
     x=E*(B-A) ;
     cout<<x<<endl;
  }
  else if(A == 0){
     x=D + E*B;
     cout<<x<<endl;
  }
}

C++:   GNU nano 2.5.3                       ????????????: JOI20161.c                                                     

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

	return 0;
}

C++: #include <stdio.h>
int main()
{    // Your code here!
    int a,b,c,d,e;
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&e);
    if(a<0)
    {
        printf("%d\n",(0-a)*c+d+(b-0)*e);
    }
    else if(a==0)
    {
        printf("%d\n",d+(b-0)*e);
    }
    else
    {
        printf("%d\n",(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*e+d-(a*c)<<endl;
  else cout<<b*e-a*e<<endl;
}

C++: #include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
long long rui(int n) {
	if (n == 0) {
		return 1;
	}
	else {
		long long x = rui(n - 1);
		return 2 * x;
	}
}
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>
#include <algorithm>
#include <vector>
using namespace std;

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

    return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int a,b,c,d,e,s;
	cin>>a>>b>>c>>d>>e;

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

	cout<<s<<endl;

	return 0;
}