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 <cctype>
#include <utility>
#include <algorithm>
using namespace std;

#define _gp(l) const auto gcu{getchar##l}; const auto pcu{putchar##l}
#ifdef __linux
_gp(_unlocked);
#else
_gp();
#endif
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
_T _DEF(T,in,int c){T n=0;int m=1;while(isspace(c)){c=gcu();}if(c=='-')m=-1,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
_DEF(int,in,){return in<int>(gcu());}
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
_T _SCAN(T &n){int c=gcu();return c==EOF?n=0,false:(n=in<T>(c),true);}
_SCAN(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_SCAN(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=(char)c;}}
#endif
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);} _OUT(const char *s){while(*s)pcu(*s++);} _OUT(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_OUT(string s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _OUT(vector<T> v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
_HT _OUT(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _OUTL(T&&... t){out(move(t)...);outl();}
struct range{
	int e,b=0,s=1; range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
	struct it { int v, s; it (int _v, int _s) : v(_v), s(_s) {} operator int()const{return v;} operator int&(){return v;} int operator*()const{return v;}
		it& operator++(){v+=s;return *this;} }; it begin() {return {b, s};} it end() {return {e, s};}};

int main() {
	int A {in()}, B {in()}, C {in()}, D {in()}, E {in()};
	outl((min(0, B) - min(0, A)) * C + ((A < 0 && 0 < B) ? D : 0) + (max(0, B) - max(0, A)) * E);
}

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

int main(){
  int a,b,c,d,e,ans=0;
  cin>>a>>b>>c>>d>>e;
  if(a<0)ans+=abs(a)*c,a=0;
  if(a==0) ans+=d;
  ans+=(b-a)*e;
  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;

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

  return 0;
}

C++: #include <iostream>
#include<cstdlib>
#include<queue>
#include<set>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<map>
#include<cstdio>
#include<fstream>
using namespace std;
#define rep(i,a) for(int i=0;i<a;i++)

#define mp make_pair
#define P pair<int,int>
#define ll __int64
int t[100];
int a,b,c,d,e;
int main(){
	cin>>a>>b>>c>>d>>e;
	int ans=0;
	if(a<0){ans+=c*-a;a=0;}
	if(a==0){ans+=d;}
	ans+=e*(b-a);
	cout<<ans<<endl;
	return 0;
}

C++: #include "bits/stdc++.h"
using namespace std;
#define Would
#define you
const long long INF = 1e18;
const long long MOD = 1e9 + 7;
const double pi = acos(-1);
const int SIZE = 1 << 17;
int dx[] = { 1,0,-1,0 }, dy[] = { 0,1,0,-1 }, alp[30];
long long fac[200005], finv[200005], inv[200005];
vector<long long>dij;
struct edge { long long to, cost; };
vector<vector<edge> >G;

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

	cout << ans << endl;
}

C++: #include <iostream>
using namespace std;
int main(void){
   int A,B,C,D,E,a,b;
   cin >> A >> B >> C >> D >> E;
   if(A<0){
       a=-(A*C);
       b=B*E;
       cout << a+D+b << endl;
   }else if(A>0){
       a=B-A;
       b=a*E;
       cout << b << endl;
   }else if(A==0){
       a=B*E;
       cout << D+a << endl;
   }
 }

C++: #include<iostream>
#include<stdio.h>
#include<string>
#include <algorithm>
#include<cstring>
#include <math.h>
#include <iomanip>
using namespace std;

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

  if(a<0)
    ans+=abs(a-0)*c;
  
  if(a<=0)
    ans+=d;

  if(b>0)
    if(a>0)
      b=b-a;
    ans+=e*b;

  cout<<ans<<endl;

  return 0;
}

C++: #include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

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

	return 0;
}

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

int main(){
    int A, B, C, D, E;
    cin >> A; cin >> B; cin >> C; cin >> D; cin >> E;
    int pre_temp = A;
    int sum_time = 0;
    if (A <= -1){
        sum_time += -(pre_temp)*C;
        pre_temp = 0;
    }
    if (pre_temp == 0){
        sum_time += D;
    }

    cout << sum_time + (B - pre_temp)*E << endl;
}

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

int main()
{
	int a = 0, b = 0, c = 0, d = 0, e = 0;
	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 REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define REP3(i, m, n) for(int i = m, i##_len=(n);i < i##_len;i++)
#define FORVEC(i, v) for(int i = 0;i < v.size();i++)

#define INF 1000000000
#define pb(a) push_back(a)
#define llong long long
#define vi vector<int>
#define P pair<int,int>
#define all(vec) (vec.begin()),(vec.end())

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

	cout<<ans<<"\n";
	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:-A*C+D+B*E)<<endl;
    
    
    
    return 0;
}

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 <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#ifdef DEBUG
#define line() cout << "[" << __LINE__ << "] ";
#define dump(i) cout << #i ": " << i << " ";
#define dumpl(i) cout << #i ": " << i << endl;
#else
#define line(i)
#define dump(i)
#define dumpl(i)
#endif
using namespace std;
int main(int argc, char const *argv[])
{
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    if (a < 0)
    {

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