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 <cstdio>
#include <climits>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <stack>
#include <algorithm>
#include <random>
#include <iomanip>
#include <map>
#include <queue>
#include <functional>
#include <numeric>
#include <chrono>
#include <cstdlib>
using ll = long long;
using namespace std;

const ll MOD = 1e9 + 7;
const double pi = acos(-1);
typedef pair<int, int> P;
#define REP(i, n) for (int(i) = 0; (i) < (n); ++(i))
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define EPS 1e-4
#define OUTPUT(i) (cout << (ll)i << endl)
#define ALL(a) ((a).begin(), (a).end())

bool operator<(const pair<ll, ll> &a, const pair<ll, ll> &b)
{

    if (a.first == b.first)
        return a.second < b.second;

    return a.first < b.first;
}

ll gcd(ll a, ll b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

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

    //cout << fixed << setprecision(15);

    int A, B, C, D, E;
    cin >> A >> B >> C >> D >> E;
    int sum = 0;
    if (A < 0)
    {
        sum += abs(A) * C + D;
        sum += E * B;
    }
    else if (A == 0)
    {
        sum += D;
        sum += E * B;
    }
    else
    {
        sum += (B - A) * E;
    }
    cout << sum << endl;

    return 0;
}

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

int a, b, c, d, e;

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

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

C++: #include <bits/stdc++.h>
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;
  cout << ans + (b - max(0, a)) * e << endl;
  return 0;
}

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

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

	cout << ((a > 0) ? (b - a) * e : (b * e + d + (-a) * c)) << 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){
    A*=(-1);
    time=A*C+D+B*E;
  }
  else{
    time=(B-A)*E;
  }

  cout<<time<<endl;
}

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>

using namespace std;

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

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

C++: #include <iostream>

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;
    if (A <= 0) T += D;
    T += min(B - A, B) * E;

    cout << T << endl;
    return 0;
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main(void)
{
	int A,B,C,D,E,all1;
	scanf("%d %d %d %d %d",&A,&B,&C,&D,&E);
	if(A<0)
	{
		all1=A*(-C);
		A=0;
	}
	if(A==0){all1+=D;}
	all1+=(B-A)*E;
	printf("%d\n",all1);
	return 0;
}
//7:18.047clear

C++: #include<iostream>
#include<algorithm>
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;
	b-=a;
	ans+=b*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;
	int answer = -a * c + d + b * e;
	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(void){
  int a,b,c,d,e,ans;
  
  cin >> a >> b >> c >> d >> e;
  if (a<0){
    ans = -a*c+d+b*e;
  } else {
    ans = (b-a)*e;
  }
  cout << ans << endl;
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <sstream>
#include <cstdlib>
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{
		cout<<(-a*c)+d+b*e<<endl;
	}
	return 0;
}

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = long long;
using P = std::tuple<int,int>;

const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};

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

    int A, B, C, D, E;
    std::cin >> A >> B >> C >> D >> E;

    int res;
    if(A < 0){
        res = (-A) * C + D + B * E;
    }else{
        res = (B - A) * E;
    }

    std::cout << res << std::endl;
}

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;

	return 0;
}

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

int a, b, c, d, e;

int main()
{
    cin >> a >> b >> c >> d >> e;
    cout << (a < 0 ? (-a) * c : 0) + (a <= 0 ? d : 0) + (a > 0 ? (b - a) * e : b * e) << endl;
}

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

int main() {
	int A, B, C, D, E, ans = 0;
	cin >> A >> B >> C >> D >> E;
	for (int i = A; i < B; ++i) {
		if (0 < i) ans += E;
		else if (0 == i) ans += D + E;
		else ans += C;
	}
	cout << ans << endl;
}

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(int temp=a;temp<0;temp++){
         time +=c;
     }
     temp =0;
     time += d;
     }
     
         for(;temp<b; temp++){
             time +=e;
         }
       
     cout << time << endl;
 }

C++: #include<bits/stdc++.h>
#define SIZE 100005
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int A,B,C,D,E,ans;

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

	if(A<0){
		ans = -A*C+D+B*E;
	}else{
		ans = E*(B-A);
	}
	
	cout << ans << endl;
	return 0;
}

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