Chef is playing a variant of Blackjack, wherenumbers are drawn and each number lies between and (with both and inclusive). Chef wins the game when the sum of these numbers is exactly .
Given the first two numbersand , that have been drawn by Chef, what should be -rd number that should be drawn by the Chef in order to win the game?
Note that it is possible that Chef cannot win the game, no matter what is the-rd number. In such cases, report as the answer.
- The first line will contain an integer – number of test cases. Then the test cases follow.
- The first and only line of each test case contains two integers and – the first and second number drawn by the Chef.
For each testcase, output the-rd number that should be drawn by the Chef in order to win the game. Output if it is not possible for the Chef to win the game.
Sample Input 1
3 1 10 1 5 4 9
Sample Output 1
10 -1 8
Test case: The first two numbers are and . If the third number will be , the resulting sum will be . So Chef will win the game if the third number is .
Test case: The first two numbers are and . There is no number between and , that can make the resulting sum . Hence, the answer will be in this test case.