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

C++: # include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)    (x).begin(),(x).end()
# define UNIQ(c)   (c).erase(unique(ALL((c))), end((c)))
# define mp        make_pair
# define eb        emplace_back
# define REP(i, a) for (int i = 0; i < (a); i++)
# define INIT      std::ios::sync_with_stdio(false);std::cin.tie(0);


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

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++: #include <iostream>

using namespace std;

int main(){
	int A, B, total;
	int sc, sd, se;

	cin >> A >> B >> sc >> sd >> se;

	total = 0;
	if (A < 0 && B > 0){
		total += sd;
	}

	for (int i = A; i < B; i++){
		if (i < 0){
			total += sc;
		}
		else {
			total += se;
		}
	}

	cout << total << endl;

	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T> V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> > Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T> mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }

/*
 <url:>
 問題文============================================================
 =================================================================
 解説=============================================================
 ================================================================
 */

ll solve(){
    ll res = 0;
    ll A,B,C,D,E; cin >> A >> B >> C >> D >> E;
    if(A < 0){
        res = abs(A)*C+D+E*B;
    }else{
        res = E*(B-A);
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    cout << solve() << endl;
    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)+d+(b*e);
	}
	if(a>0){
		x=(b-a)*e;
	}
	printf("%d\n",x);
	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>
#include<algorithm>
#include<cmath>
#include<cstdio>
using namespace std;
int main(void){
	int  A,B,C,D,E,ANS=0;
	cin>>A>>B>>C>>D>>E;
	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<iomanip>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<sstream>
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
typedef long long ll;
////////////////////////////////////////////////////////////

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

	cout << ans << endl;
	ret 0;
}

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

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
const long long MOD = 1000000007;
using namespace std;
typedef long long ll;
map<ll, int> mp;
signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e;
	if (a < 0) {
		cout << c * abs(a) + d + b * e << endl;
	}
	else {
		cout << (b - a) * e << endl;
	}
	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&&B>0)
    {
        cout<<(0-A)*C+D+B*E<<endl;
    }
    if(A<0&&B<0)
    {
        cout<<(A-B)*C<<endl;
    }
    if(A>0&&B>0)
    {
        cout<<(B-A)*E<<endl;
    }
    return 0;
}

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

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