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 <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,tim;
    cin>>a;
    cin>>b;
    cin>>c;
    cin>>d;
    cin>>e;
    
    if (a<0){
        tim=0-a*c+d+b*e;
    }else if(a==0){
        tim=d+b*e;
    }else if(a>0){
        tim=(b-a)*e;
    }
    cout<<tim<<endl;
}

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

int main(){

  int a,b,c,d,e;
  int C=0,D=0,E=0;
  int t;

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

  if(a < 0){
    while(true){
      ++a;
      ++C;
      if(a==0) break;
    }
    D = 1;
  }
    
  while(true){
    ++a;
    ++E;
    if(a==b) break;
  }

  cout << c*C + d*D + e*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 answer;
    if(A<0){
		 answer=-A*C+D+B*E;
	}
	if(A>0){
		 answer=(B-A)*E;
	}
	cout<<answer<<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 sum = 0;
    if(A<0) {
       for(int i=A;i<0;i++){
       sum = sum+C;
       }
       sum = sum+D;
       for(int b=0;b<=B;b++){
       sum = sum+E;
       }
    } else if(A==0) {
       sum = sum +D;
       for(int b=0;b<=B;b++)
       sum = sum+E;
    }
    if(A>0) {
       for(int n=A;n<=B;n++) {
       sum = sum+E;
       }
    }
    cout<<sum<<endl;
    return 0;
}

C++: #include <iostream>
#include <cmath>
using namespace std;
int main(void){
    // Your code here!
    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;
    }
}

C++: #include <bits/stdc++.h>

using namespace std;

int a, b, c, d, e;

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

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

int main(void){
	int a,b,c,d,e;
	cin >> a >> b >> c >> d >> e;
	cout << ((a<0)?(abs(a)*c+d+b*e):((b-a)*e)) << endl;
	return 0;
}

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

int main (void)
{
    int A, B, C, D, E;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> D;
    cin >> E;
    int sec = 0;
    int l = 0;
    while (A < B)
    {
        if (A < 0)
        {
            A++;
            sec += C;
        }
        else if (A == 0 && l == 0)
        {
            sec += D;
            l++;
        }
        else
        {
            A++;
            sec += E;
        }
    }
    cout << sec << endl;
}

C++: #include <iostream>
using namespace std;
#include <cstdio>
#include <cmath>
#include <cstring>
#include <string>
#include <algorithm>
#include <functional> //sort(A,A.end(),greater<int>());???????????????
#include <queue>
#include <stack>
#include <vector>

#define INF 10 << 10

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

C++: #include <bits/stdc++.h>
#define fo(i,a) for(i = 0;i < a;i++)
using namespace std;
int main(void)
{
	int a,b,c,d,e,n=0;
	
	cin >> a >> b >> c >> d >> e ;
	if(a < 0) a = a * -1 ;
	else{
		b -= a ;
		a = 0 ;
		d = 0 ;
	}
	n = a * c + d + b * e ;
	cout << n << endl ;
	
	return 0 ;
}

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




}

C++: #include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,d,e,count=0,flag=0;
    cin>>a>>b>>c>>d>>e;
    while (a<b) {
        if (a<0) {
            count+=c;
            a++;
        } else if (a==0&&flag==0) {
            count+=d;
            flag++;
        } else {
            count+=e;
            a++;
        }
    }
    cout<<count<<endl;
}

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

int main(){
    int a, b, c, d, e, ans;
    
    cin >> a >> b >> c >> d >> e;
    
    if(a < 0){
        ans = c*d+10;
        a = 0;
    }
    
    b = b - a;
    
    ans += b*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;
	
	if (n < 0)
	{
		p = 0;
		p = x * (0 - n);
	
	
		q = 0;
		q = y;
		
		r = 0;
		r = z * a;
		cout << p + q + r << endl;	
	}
	else if (n == 0)
	{
		p = 0;
		q = 0;
				q = y;
				
				r = 0;
				r = z * a;
				cout << p + q + r << endl;	
	}
	else if (n > 0)
	{p =0 ;
	q = 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;
	if (a > 0){
		cout << (b - a) * e;
	}
	else{
		cout << (0 - a) * c + d + b * e;
	}
	cout << endl;
}

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

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

C++: #include <iostream>
using namespace std;
int main(){
	int a,b,c,d,e,f;
	cin>>a;	cin>>b;	cin>>c;	cin>>d;	cin>>e;

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

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

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

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

C++: #include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a; //Aの元々の温度
    int b; //Bの目的の温度
    int c, d, e;
    cin >> a;
    cin >> b;
    cin >> c;
    cin >> d;
    cin >> e;
    if(a>0)
        cout << (b-a)*e << endl;
    else if(a==0)
        cout << d+e*b << endl;
    else
        cout << c*(-a)+d+e*b << endl;
}