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

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

int main(){
    printf("%.9999999999999d",100.0);
    }

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <random>
using namespace std;
typedef long long int ll;

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

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;
	}
	else if(a == 0){
		cout << d + (b - a) * e;
	}
	else{
		cout << (b - a) * e;
	}
	cout << endl;
	return 0;
}

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

C++: #include<iostream>
#include<stdlib.h>

using namespace std;

int main(){

  int A,B,C,D,E;
  int i;
  int time;
  int tap;

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

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

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

}

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

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

C++: #include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "cmath"
#include "random"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	cin >> N >> M >> K >> L >> R;
	int ans = 0;
	if (N < 0) {
		ans += abs(N)*K;
		N = 0;
	}
	if (!N) {
		ans += L;
	}
	ans += (M - N)*R;
	cout << ans << endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=1000000007,MAX=1<<18;
const ll INF=1LL<<55;

int main(){
    
    //std::ifstream in("text.txt");
    //std::cin.rdbuf(in.rdbuf());
    
    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;
    
    
}

C++: // clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return ~n & 1; }
template<typename T> int len(const T &v) { return v.size(); }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

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

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-a)*e);
	}
	return 0;
}

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

int main(){
  int a,b,c,d,e;
  int 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;
}