Chef wants to gift
chocolates to Botswal on his birthday. However, he has only chocolates with him.
The cost of chocolate is rupees.
Find the minimum money in rupees Chef needs to spend so that he can gift chocolates to Botswal.
Input Format
- First line will contain , number of test cases. Then the test cases follow.
- Each test case contains of a single line of input, three integers and .
Output Format
For each test case, output in a single line answer, the minimum money in rupees Chef needs to spend.
Constraints
Sample Input 1
2
7 5 5
10 1 1
Sample Output 1
10
9
Explanation
Test Case : Chef has to gift a total of chocolates out of which he has chocolates. Thus, Chef needs to buy more chocolates, which costs him rupees.
Test Case : Chef has to gift a total of chocolates out of which he has chocolate. Thus, Chef needs to buy more chocolates, which costs him rupees
No comments:
Post a Comment