Solubility ! In C++ May Challenge 2021 Division 3
Problems
Suppose for a unit rise in temperature, the solubility of sugar in water increases by .
Chef does an experiment to check how much sugar (in ) he can dissolve given that he initially has liter of water at degrees and the solubility of sugar at this temperature is . Also, Chef doesn't want to lose any water so he can increase the temperature to at most degrees.
Assuming no loss of water takes place during the process, find the maximum amount of sugar (in ) can be dissolved in liter of water under the given conditions.
Input
- The first line contains an integer , the number of test cases. Then the test cases follow.
- The only line of each test case contains three integers .
Output
For each testcase, output in a single line the answer to the problem.
Constraints
Subtasks
Subtask #1 (100 points): Original Constraints
Sample Input
3
40 120 1
35 120 2
40 115 3
Sample Output
1800
2500
2950
Explanation
Test Case : Since solubility is increasing with temperature, the maximum solubility will be at degrees which is equal to .
So for liter of water the value is .
Test Case : Since solubility is increasing with temperature, the maximum solubility will be at degrees which is equal to .
So for liter of water the value is .