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,ans=0,br=0;
  cin>>a>>b>>c>>d>>e;
  while(a<0&&br==0){
    ans+=c;
    a++;
    if(a==b){
      br++;
    }
  }
  if(br==0){
    if(a==0){
      ans+=d;
    }
    if(b>0){
      for(int i=a;i<b;i++){
	ans+=e;
	a++;
      }
    }
  }
  cout<<ans<<endl;
}

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>
#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>>y>>z>>h>>j>>k;
   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 <cstdio>

int A,B,C,D,E;

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

C++: #include <cstdio>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < n; ++i)

using namespace std;

int a, b, c, d, e, t;

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

C++: #define _USE_MATH_DEFINES
#include "bits/stdc++.h"
using namespace std;

//#define int long long
#define DBG 1
#define dump(o) if(DBG){cerr<<#o<<" "<<o<<endl;}
#define dumpc(o) if(DBG){cerr<<#o; for(auto &e:(o))cerr<<" "<<e;cerr<<endl;}
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define each(it,c) for(auto it=(c).begin();it!=(c).end();it++)
#define all(c) c.begin(),c.end()
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9 + 7);
const double EPS = 1e-10;

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

C++: #include "bits/stdc++.h"
using namespace std;
int A, B, C, D, E;
int solve(int from) {
	int sum = 0;
	if (from < 0) {
		return -from*C + D +100 * E;
	}
	else {
		return (100 - from)*E;
	}
}


int main() {
	cin >> A >> B >> C >> D >> E;
	cout << solve(A) - solve(B) << endl;
	return 0;
}

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

using namespace std;

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

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

C++: #include <cstdio>
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
using namespace std;

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

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
    int A,B,C,D,E;
    cin>>A>>B>>C>>D>>E;
    int T=A;
    int ans=0;
    int c=1;
    if(A<0)c=0;
    while(1){
        if(T==B)break;
        if(T<0)ans=ans+C;
        if(c==0){ans=ans+D;c=1;}
        if(T>=0)ans=ans+E;
        T++;
    }
    cout<<ans<<endl;
    return 0;
}

C++: // 2018/12/19 Tazoe

#include <iostream>
using namespace std;

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

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

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

  return 0;
}

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

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

	cin >> a >> b >> c >> d >> e;

	int x;

	if(a > 0){
		x = e*(b-a);
	}
	if(a == 0){
		x = e*b + d;
	}
	if(a < 0){
		x = -c*a + e*b + d;
	}

	cout << x << endl;


	return 0;
}

C++: #include<bits/stdc++.h>
using namespace std ;
int main()
{
    int a = 0 ;
    int b = 0 ;
    int sec[3] = {0} ;
    cin >> a >> b >> sec[0] >> sec[1] >> sec[2] ;

    if ( a < 0 )
    {
        sec[0] = ( 0 - a ) * sec[0] ;
        sec[2] = b * sec[2] ;
    }
    else
    {
        sec[0] = 0 ;
        sec[1] = 0 ;
        sec[2] = ( b - a ) * sec[2] ;
    }

    cout << sec[0]+sec[1]+sec[2] << endl ;
    return 0 ;
}

C++: #include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

template<class T>
constexpr T INF = ::numeric_limits<T>::max() / 32 * 15 + 208;

int main() {
    int a, b, c, d, e;
    cin >> a >> b >> c >> d >> e;
    ll t = 0;
    while(a < b){
        if(a < 0) a++, t += c;
        else if(a == 0) a++, t += d+e;
        else a++, t += e;
    }
    cout << t << "\n";
    return 0;
}

C++: #include <bits/stdc++.h>
#define range(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, a) range(i, 0, a)
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;
    if (a <= 0) ans += d;
    cout << ans + e * (b - max(a, 0)) << 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 ans = 0;
	if(a<0){
		ans+= -a*c;
		a = 0;
	}
	
	if(a==0)ans += d;
	if(a>=0) {
		 ans+=(b-a)*e;
	}
	
	cout<<ans<<endl;
	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int ans=0;
  while(a<0){
    a++;
    ans+=c;
  }
  if(a==0)
    ans+=d;
  while(a!=b){
    a++;
    ans+=e;
  }
  cout<<ans<<endl;
  return 0;
}

C++: #include <stdio.h>
int main (void){
	int tempa,tempb,c,d,e,f,g,h,i,j;
	scanf("%d %d %d %d %d",&tempa,&tempb,&c,&d,&e);
	if(tempa<=0){
	h=-tempa*c+d+e*tempb;
		printf("%d\n",h);
	}
	else if(tempa>0){
		g=(tempb-tempa)*e;
		printf("%d\n",g);
	}
	else{
		i=d+e*tempb;
		printf("%d\n",i);
	}
	return 0;
}