#P10862. Contest Burger Budget
Contest Burger Budget
Contest Burger Budget
During a long programming contest, preparing food for the contestants can be challenging. In the 20XX International Collegiate Programming Contest in Hubei Province, China, there were $$n$$ contestants. The host planned to serve a Spicy Chicken Burger Set for every contestant at a cost of $$a$$ dollars per set. However, since some contestants (like Walk Alone) cannot bear the spiciness, a Grilled Chicken Burger Set costing $$b$$ dollars per set was prepared for those who requested it. Before the contest, the host collected the number $$x$$ of contestants who wanted the Grilled Chicken Burger Set.
Your task is to help calculate the total expense of the food preparation. The total cost is calculated as follows:
inputFormat
The input consists of four space-separated integers:
- $$n$$: the total number of contestants
- $$a$$: the cost of one Spicy Chicken Burger Set
- $$b$$: the cost of one Grilled Chicken Burger Set
- $$x$$: the number of contestants who requested the Grilled Chicken Burger Set
outputFormat
Output a single integer representing the total cost for preparing the burger sets. The total cost is given by:
sample
100 5 3 20
460