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>
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",y);
	}
	else{
		x=b*e;
		y=x+d;
		printf("%d\n",y);
	}
	return 0;
}

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

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

C++:   GNU nano 2.5.3                       ????????????: JOI20161.c                                                     

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

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll ,P> P3;
const ll MOD = ll(1e9+7);
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(1e5 + 5);
const double EPS = 1e-6;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

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

C++: #include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<vector>

using namespace std;

int main(){
	int m[5];
	int t;
	for(int i=0;i<5;i++) scanf("%d",&m[i]);
	if(m[0]<0){
		t=m[2]*((-1)*(m[0]))+m[3]+(m[4]*m[1]);
	}
	else if(m[0]==0){
		t=m[3]+(m[4]*m[1]);
	}
	else{
		t=(m[1]-m[0])*m[4];
	}
	printf("%d\n",t);
}

C++: #include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

    int ans = 0;

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

    ans += (b-a) * e;
    cout << ans << endl;
}

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

int a, b, c, d, e;

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

C++: #include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

int main()
{
    int a,b,c,d,e;
    cin >>a >>b >>c >>d >>e;
    int ans=0;
    for(int i=a; i<b; ++i)
    {
        if(i<0) ans+=c;
        else if(i>0) ans+=e;
        else ans+=d+e;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

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

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 + D;
    A = 0;
  }
  t += (B - A) * E;

  cout << t << endl;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e;
	cin>>a>>b>>c>>d>>e;
	cout<<-min(0,a)*c+(a<0)*d+(b-max(a,0))*e<<endl;
}

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

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int A,B,C,D,E,ans=0;
    cin>>A>>B>>C>>D>>E;
    if(A<0){
        ans=(0-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<<c*d+b*e+10<<endl;
	}
	return 0;
}

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(void){
   int A, B, C, D, E, time=0;
   cin >> A >> B >> C >> D >> E;
   
   if(A<0){
        time += (-A)*C;
        time += D;
        time += B*E;
   }
   else{
       time += (B-A)*E;
   }
   
   cout << time << 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;
	cout << (C * max(0, -A) + (A <= 0 ? D : 0) + E * (B - max(0, A))) << endl;
	return 0;
}