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;
	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<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,d,e; cin>>a>>b>>c>>d>>e;
    int t=0;
    if(a<0){
	t+=((-a)*c+d);
	a=0;
    }
    t+=(b-a)*e;
    cout<<t<<endl;
    return 0;
}

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

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+=c*abs(a);
        ans+=d;
        ans+=e*b;
    }
    else if(a==0){
        ans+=d;
        ans+=e*b;
    }
    else if(a>0){ans+=e*(b-a);}
    cout << ans << 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 res = 0;
  res += min(a, 0) * -1 * c;
  res += (a < 0 ? d : 0);
  res += (b - max(a, 0)) * e;
  cout << res << endl;
  return 0;
}

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

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

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

using namespace std;

#define ZFor(i,n) for(int i=0;i<n;i++)
#define WFor(i,n) for(int i=1;i<=n;i++)
#define ZWFor(i,n) for(int i=0;i<=n;i++)
#define WZFor(i,n) for(int i=1;i<n;i++)
#define Max -2100000000
#define Min 2100000000
#define F first
#define S second
#define F1 first.first
#define F2 first.second
#define F3 second

typedef pair<int,int> P;
typedef pair<pair<int,int>,int> PP;


int main(void){
	
	int a[5],ans;
	
	ZFor(i,5)scanf("%d",&a[i]);
	
	if(a[0]<0){
		a[0]*=-1;
		ans=a[0]*a[2];	
		ans+=a[1]*a[4];
		ans+=a[3];
	}else{
		a[1]-=a[0];
		ans+=a[1]*a[4];
	}
	
	printf("%d\n",ans);
	
	return 0;
}

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

C++: #include <bits/stdc++.h>  
 
using namespace std;
 
#define FOR(i, j, k) for(int i = j; i < k; ++i)
#define rep(i, j) FOR(i, 0, j)
#define repr(i, j) for(int i = j; i >= 0; --i)
#define INF (1 << 30)
#define MOD 1e9 + 7
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;

int main() {
	int a, b, c, d, e;
	scanf("%d %d %d %d %d", &a, &b, &c, &d, &e);
	int ans = 0;
	if(a < 0) {
		ans += abs(c * a);
		ans += d;
		a = 0;
	}
	ans += (b - a) * e;
	printf("%d\n", ans);
	return 0;
}

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

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

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

C++: #include <iostream>
#include <stdio.h>
#include <string>
#include <string.h>

using namespace std;

int main (void)
{
	int n,a,b,x,y,z,p,q,r;
	cin >> n >> a >> x >> y >> z;
	
		p = 0;
		p = x * (0 - n);
		
		q = 0;
		q = y;
		
		r = 0;
		r = z * a;
		cout << p + q + r << endl;	
	
}

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

C++: #include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
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 main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;
    int sum = 0;
    if(A < 0){
        sum += (-A)*C + D;
        A = 0;
    }
    cout << sum + (B-A)*E << 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<<-A * C + D + E * B<<endl;
  if(A > 0) cout<<E * (B - A)<<endl;

  return 0;
}