https://www.acmicpc.net/problem/14470
#include <iostream>
using namespace std;
int main() {
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
int time=0;
if(a<0){
time+=abs(a)*c;
a=0;
}
if(a==0) time+=d;
time+=(b-a)*e;
cout<<time;
}