luogu#P10862. [HBCPC2024] Spicy or Grilled?
[HBCPC2024] Spicy or Grilled?
题目描述
Since a regular programming contest lasts for five hours, it's a big problem to prepare contestants' food during the contest.
In the 20XX International Collegiate Programming Contest in Hubei Province, China, there were contestants participating in the contest. The host wanted to prepare a Spicy Chicken Burger Set for every contestant, which was dollars per set at that time. But since there were some people who could not bear the spiciness like Walk Alone, a Grilled Chicken Burger Set was prepared for these people, which was dollars per set. Before the contest, the host had collected the number of people who wanted to eat a Grilled Chicken Burger Set.
But Walk Alone was too stupid and lazy to calculate how much the host would spend. Please help him to calculate.
输入格式
In the first line,there is an integer () denoting the number of test cases.
For each test case, there are four integers , , and () in each line, representing the number of contestants in total, the number of contestants who want Grilled Chicken Burger Set, the price of Spicy Chicken Burger Set and Grilled Chicken Burger Set per set.
输出格式
For each test case, output a single integer denoting the total money the host would spend.
3
600 200 27 26
750 0 26 27
750 750 1 1
16000
19500
750
提示
In the first test case, there were people chosen the Spicy Chicken Burger Set and people chosen the Grilled one. So the total money is dollars.