Problem
Chef has opened a new airline. Chef has airplanes where each airplane has a capacity of passengers.
On the first day itself, people are willing to book a seat in any one of Chef's airplanes.
Given that Chef charges rupees for each ticket, find the maximum amount he can earn on the first day.
Input Format
- The first line of input will contain a single integer , denoting the number of test cases.
- Each test case consists of three space-separated integers and — the capacity of each airplane, the number of people willing to book a seat in any one of Chef's airplanes on the first day, and the cost of each seat respectively.
Output Format
For each test case, output on a new line, the maximum amount Chef can earn on the first day.
Constraints
Sample 1:
4 2 15 10 1 10 1 5 60 100 1 11 7
150 10 5000 70
Explanation:
Test case : Chef has airplanes and each airplane has a capacity of passengers. Thus, there are seats available in total.
There are people who want to book a seat. Since we have enough seats for everyone, all people can book their seats and pay rupees each. The total money Chef earns is .
Test case : Chef has airplanes and each airplane has a capacity of passenger. Thus, there are seats available in total.
There are people who want to book a seat. Since we have enough seats for everyone, all people can book their seats and pay rupee each. The total money Chef earns is .
Test case : Chef has airplanes and each airplane has a capacity of passengers. Thus, there are seats available in total.
There are people who want to book a seat. Since we have only seats, only people can book their seats and pay rupees each. The total money Chef earns is .
Test case : Chef has airplanes and each airplane has a capacity of passenger. Thus, there are seats available in total.
There are people who want to book a seat. Since we have only seats, only people can book their seats and pay rupees each. The total money Chef earns is .
ConversionConversion EmoticonEmoticon