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>
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<ctime>
#include<string>
#include<cstring>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int5(a, b, c, d, e);
    int res = 0;
    if(a * b < 0)res += d;
    if(a < 0){
      res += abs(a) * c + b * e;
    }else res += (b - a) * e;

    pri(res);

/*/

//*/ break;
  }
  return 0;
}

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

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

int a[100000000};
int main(){
    memset(a,-1,sizeof(-1));
    }

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

C++: // #pragma GCC target("avx")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
// #define BEGIN_STACK_EXTEND(size) void * stack_extend_memory_ = malloc(size);void * stack_extend_origin_memory_;char * stack_extend_dummy_memory_ = (char*)alloca((1+(int)(((long long)stack_extend_memory_)&127))*16);*stack_extend_dummy_memory_ = 0;asm volatile("mov %%rsp, %%rbx\nmov %%rax, %%rsp":"=b"(stack_extend_origin_memory_):"a"((char*)stack_extend_memory_+(size)-1024));
// #define END_STACK_EXTEND asm volatile("mov %%rax, %%rsp"::"a"(stack_extend_origin_memory_));free(stack_extend_memory_);

#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<unordered_map>
#include<complex>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const long double EPS=1e-20;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3100000;
const int UF_SIZE = 3100000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
	int UF[UF_SIZE];
	void init_UF(int n){
		for(int i=0;i<n;i++)UF[i]=-1;
	}
	int FIND(int a){
		if(UF[a]<0)return a;
		return UF[a]=FIND(UF[a]);
	}
	void UNION(int a,int b){
		a=FIND(a);b=FIND(b);if(a==b)return;
		if(UF[a]>UF[b])swap(a,b);
		UF[a]+=UF[b];UF[b]=a;
	}
}
// ここから編集しろ

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

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

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

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

  cout << ans << endl;
}

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

C++: #include <iostream>

using namespace std;
int a;
int b;
int c;
int d;
int e;
int f;
int timel;
int main(){
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	if (a < 0){
		timel += (0 - a)*c;
		a = 0;
	}
	if (a == 0){
		timel += d;
		f = 1;
	}


	if (a >= 0){
		timel += (b - a)*e;

	}

	cout << timel << endl;

	return 0;
}

C++: #include<iostream>
using namespace std;
int main(){
	int A,B,C,D,E,x=0,y=0;
	cin>>A;
	cin>>B;
	cin>>C;
	cin>>D;
	cin>>E;

	if(0>A){
		x=A*C*-1+D+B*E;
	}
	else if(0<A){
		y=(B-A)*E;
	}
	else{
		x=D+((B-A)*E);
	}
	cout<<x+y<<endl;

return 0;
}

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

C++: #include <stdio.h>

int main(void) {
  int a, b, c, d, e;
  scanf("%d%d%d%d%d", &a, &b, &c, &d, &e);
  if(a < 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(void){
    int A,B,C,D,E,Q,x,y,z,u,v,n,m;
    cin >> A >> B >> C >> D >> E;
    Q=B-A;
    if(A<0){
        x=0-A;
        y=x*C;
        z=Q-x;
        u=z*E;
        n=y+D+u;
        cout << n << endl;
    }
    else if(A>0){
        v=Q*E;
        m=v;
        cout << m << endl;
        
    }
}