https://www.acmicpc.net/problem/14470
import java.util.*;
fun main(args: Array<String>) {
val s=Scanner(System.`in`)
var a=s.nextInt()
var b=s.nextInt()
var c=s.nextInt()
var d=s.nextInt()
var e=s.nextInt()
var time=0
if(a<0){
time+=Math.abs(a)*c
a=0
}
if(a==0) time+=d
time+=(b-a)*e
print(time)
}