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 <cmath>
using namespace std;
int main(void){
    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;
}
}

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

using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int A, B, C, D, E;
  cin >> A >> B >> C >> D >> E;
  int t = 0;
  if (A < 0) {
    t = abs(A) * C + D + B * E;
  } else {
    t = (B - A) * E;
  }
  cout << t << "\n";
  return 0;
}

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

C++: #include <iostream>
#include<cmath>
using namespace std;
int main(void){
    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(){
 int time=0,dest,temp,C,D,E;
 cin>>temp>>dest>>C>>D>>E;
 if(temp<0)time=-temp*C;
 if(temp<0){
 	time=time+D;
	temp=0;
 }
 cout<<time+(dest-temp)*E<<endl;
}

C++: #include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cctype>
#include<string.h>
#include <stdlib.h>

#define PI 3.1415926
void swap(int* x, int* y) {
	int a = *x;
	int b = *y;
	*x = b;
	*y = a;
}
void dainyu(int X[], int Y[ ],int n,int m) {
	for (int i = n; i <= m; i++) {
		Y[i] = X[i];
	}
}
void Dscanf(int X[], int n, int m) {
	for (int i = n; i <= m;i++) {
		scanf("%d", &X[i]);
	}
}
void Dprintf(int X[], int n, int m) {
	for (int i = n; i <= m; i++) {
		printf("%d\n", X[i]);
	}
}
void reverse(int X[], int Y[],int n,int m) {
	for (int i = n; i <= m; i++) {
		Y[i] = X[n + m - i];
	}
}

int factorial(int n);
int sum(int n, int*);
int ave(int n, int*);
int min(int n, int*), min(int n, int m);
int max(int n, int*), max(int n, int m);

int main() {
	int A, B, C, D, E;
	scanf("%d %d %d %d %d", &A, &B, &C, &D, &E);
	int t = 0;
	if (A < 0) {
		t = -A *C+D+B*E;
	}
	else {
		t = (B - A)*E;
	}
	printf("%d\n", t);
	return 0;
}

int factorial(int n) {
	if (n > 0) {
		return n * factorial(n - 1);
	}
	else {
		return 1;
	}
}
int sum(int n, int *all) {
	int total = 0;
	for (int i = 0; i < n; ++i) {
		total += all[i];
	}
	return total;
}
int ave(int n, int *all) {
	int total = 0;
	for (int i = 0; i<n; ++i) {
		total += all[i];
	}
	return total / n;
}
int min(int n, int *all) {

	int min = all[0];
	for (int i = 1; i < n; ++i) {
		if (all[0] > all[i]) {
			min = all[i];
		}
	}
	return min;
}
int max(int n, int *all) {
	int max = all[0];
	for (int i = 1; i<n; ++i) {
		if (all[0]<all[i]) {
			max = all[i];
		}
	}
	return max;
}
int max(int n, int m) {
	if (n >= m) {
		return n;
	}
	else {
		return m;
	}
}
int min(int n, int m) {
	if (n >= m) {
		return m;
	}
	else {
		return n;
	}
}

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

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

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

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 -= c * a - d;
		a = 0;
	}
	ans += (b - a)*e;
	printf("%d\n", ans);
	return 0;
}

C++: #include<iostream>

using namespace std;

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

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


  if(A > 0) cout<<(B-A)*E<<endl;
  if(A == 0) cout<<D+(B*E)<<endl;
  if(A < 0) cout<<D+(B*E)+C*(-A)<<endl;

 return 0;
}

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;#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;
}

                v=b*e;
        }
        else
        {
                w=0;
                m=0;
                v=(b-a)*e;
        }
        cout<<w+m+v<<endl;
        return 0;
}

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

#include <iostream>
#include<algorithm>
#include<cstdlib>
using namespace std;
int A,B,C,D,E;
int X[10001],Y[10001];
int main() {
	cin>>A>>B>>C>>D>>E;

	if(A==0)cout<<D+B*E<<endl;
	if(A<0)cout<<((0-A)*C)+D+(B*E)<<endl;
	if(A>0)cout<<(B-A)*E<<endl;


	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1LL<<59)

#define int ll

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