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<stdio.h>
#include<iostream>
using namespace std;
int main(){
int a,b,c,d,e,g=0;
cin>>a>>b>>c>>d>>e;
if(a<0){
g+=(0-a)*c+d;
a=0;
}
g+=(b-a)*e;
cout<<g<<endl;
return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int x,y,a,b,c;
int main() {
  cin>>x>>y>>a>>b>>c;
  cout<<(x<0?-x*a+b:0)+(y-max(0,x))*c<<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-A)*E;
  }
  printf("%d\n",T);
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(void)
{
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	int f=0;
	if (a<0)
	{
		for (;;)
		{
			a=a+1;
			f=f+c;
			if (a==b)
			{
				cout<<f<<endl;
				return 0;
			}
			if (a==0)
			{
				f=f+d;
				break;
			}	
		}
	}
	else if (a>=0)
	{
		for (;;)
		{
			if (a==b)
			{
				cout<<f<<endl;
				return 0;
			}
			a=a+1;
			f=f+e;
		}
		
	}
	return 0;	
}

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

int a[100000000];
int main(){
    memset(a,-1,sizeof(a));
    }

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

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

using namespace std;

int main() {

	int A, B, C, D, E;

	scanf("%d", &A);
	scanf("%d", &B);
	scanf("%d", &C);
	scanf("%d", &D);
	scanf("%d", &E);

	if (A < 0) {
		printf("%d\n", -A*C + D + B*E);
	}
	else {
		printf("%d\n", (B - A)*E);
	}

	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std;
int A,B,C,D,E,ans=0;
main(){
  cin>>A>>B>>C>>D>>E;
  if(A>0){
    ans=(B-A)*E;
  }else if(A==0){
    ans=D+B*E;
  }else{
    ans=abs(A)*C+D+B*E;
  }
  cout<<ans<<endl;
  return 0;
}

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

    cout << t << endl;
}

C++: #include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<cstring>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<cstdlib>
#include<list>
#include<set>
#include<numeric>

#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

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

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

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

C++: #include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(ll i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

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

C++: #include "iostream"
#include "string"
#include "algorithm"
using namespace std;

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

C++: #include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

void print_vec(vector<int> vec)
{
  cout << "[";
  for (int i = 0; i < vec.size(); i++)
  {
    cout << vec.at(i) << ", ";
  }
  cout << "]" << endl;
}

int 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;

  printf("%d\n", ans);
}

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 += abs(a)*c +d;
		a = 0;
	}
	ans += (b-a)*e;
	cout << ans << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	cout<<max(0,-a)*c+(b-max(a,0))*e+(a<0?d:0)<<endl;
}

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

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

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

int main()
{
	int st, go;
	int ko, o, hu;

	int tim = 0;

	int i;

	cin >> st >> go >> ko >> o >> hu;

	for (i = st; i < go; i++)
	{
		if (i < 0)
		{
			tim += ko;
		}

		else if (i > 0)
		{
			tim += hu;
		}

		else
		{
			tim += o + hu;
		}
	}

	cout << tim << endl;

	return 0;
}

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

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