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++:   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=d*e;
        }
        else
        {
                w=0;
                m=0;
                v=d*e;
        }
        cout<<w+m+v<<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 << -(a)*c + 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;
  int s=0;
  cin >>a>>b>>c>>d>>e;
  if(a<0){
    s+=a*c*(-1)+d;
    a=0;
  }
  s+=(b-a)*e;
  cout <<s<<endl;
  return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
    int a,b,c,d,e;
    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;
}

C++: #include <iostream>
using namespace std;
int main(){

    int A,B,C,D,E;
    cin >> A >> B >> C >> D >> E;

    int answer;
    if(A < 0){
        answer = -A * C + D + B * E;
    }
    if(A > 0){
        answer = (B - A) * E;
    }

    cout << answer << endl;

}

C++: //JOI2018 1 Microwave
//20181208
//F_Naru
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int A,B,C,D,E;
  cin >> A >> B >> C >> D >> E;
  int second=0;
  int now_C=A;
  while(now_C<B and now_C<0){
    second+=C;
    now_C++;
  }
  if(now_C!=B and now_C==0){
    second+=D;
  }
  while(now_C<B and now_C>=0){
    second+=E;
    now_C++;
  }
  cout << second << endl;
  
}

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

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

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

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

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

int main()
{
    int A, B, C, D, E;
    int s = 0;

    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    cin >> E;

    if (A < 0){
        for (int i  = A; i < 0; i++){
            s += C;
        }
        s += D;
        for (int i = 1; i <= B; i++){
            s += E;
        }
        cout << s << endl;
        return (0);
    }
    else if (A == 0){
        s += D;
        for (int i = 1; i <= B; i++){
            s += E;
        }
        cout << s << endl;
        return (0);
    }
    else {
        for (int i = 1; i <= B; i++){
            s += E;
        }
        cout << s << endl;
        return (0);
    }
}

C++: #include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#pragma warning(disable : 4996)
using namespace std;
int a, b, c, d, e;
int f(int x) {
	if (x < 0) return c * (x + 1000);
	return c * 1000 + d + e * x;
}
int main() {
	cin >> a >> b >> c >> d >> e;
	cout << f(b) - f(a) << endl;
	return 0;
}

C++: #include<iostream>

using namespace std;

int main()
{
  int a,b,c,d,e,f;
  cin>>a>>b>>c>>d>>e;
  if(a<=0) cout << (-1)*a*c+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;
 
    int counter = 0;
    if (a <= 0) {
        counter += -a * c + d + b * e;
    }
    else {
        counter += (b-a) * e;
    }
     
    cout << counter << endl;
}

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

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

C++: //https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0630?year=2017

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

/*
 *
 */

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    // Your code here!
    int A;
    int B;
    int C;
    int D;
    int E;
    int ans = 0;
    
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    cin >> E;
    
    if (A < 0) {
        int min_val = min(0, B);
        ans += abs((A - min_val) * C);
        A = min_val;
    }
    if (A == 0 && A < B) {
        ans += D;
    }
    if (A < B) {
        ans += (B - A) * E;
    }
    
    cout << ans << endl;
    
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    int a,b,c,d,e,f,g,h,i,j,k;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    f=abs(a);
    g=f*c;
    h=b-a;
    i=h*e;
    j=b*e;
    if(a<0){
        k=g+d+j;
        cout<<k<<endl;
    }
    else if(a>0){
        cout<<i<<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 << endl;
	else
		cout << (b - a) * e << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main() {
	int a, b, c, d, e,on,hun;
	cin >> a >> b >> c >> d >> e;
	on = a;
	hun = 0;
	if (a <= 0) {
		while (on != 0) {
			on = on + 1;
			hun = hun + c;
		}
		hun = hun + d;
	}
	while (on != b) {
		on = on + 1;
		hun = hun + e;
	}
	cout << hun << endl;
}