Chef has a bucket having a capacity of
liters. It is already filled with liters of water.
Find the maximum amount of extra water in liters that Chef can fill in the bucket without overflowing.
Input Format
- The first line will contain - the number of test cases. Then the test cases follow.
- The first and only line of each test case contains two space separated integers and - as mentioned in the problem.
Output Format
For each test case, output in a single line, the amount of extra water in liters that Chef can fill in the bucket without overflowing.
Constraints
Sample Input 1
2
5 4
15 6
Sample Output 1
1
9
Explanation
Test Case : The capacity of the bucket is liters but it is already filled with liters of water. Adding more liter of water to the bucket fills it to liters. If we try to fill more water, it will overflow.
Test Case : The capacity of the bucket is liters but it is already filled with liters of water. Adding more liters of water to the bucket fills it to liters. If we try to fill more water, it will overflow.
No comments:
Post a Comment