You want to reach a destination but you decide that you can make moves in two directions only. If you are at position (x, y), then you can move to (x+1, y+1) or (x+1, y). You must start your journey from (0, 0) and your destination is (X, Y). Your task is to find the minimum number of moves that you require to reach the destination or if he cannot reach the destination.
Input format
Output format
For each test case, print a single line denoting the minimum number of moves that you must take to reach the destination. Print -1 if you cannot reach the destination.
Constraints
1≤T≤1000
|X|,|Y|≤1e9
He can take step from (x,y) to (x+1,y) .
So he can take step from (0,0) to (1,0).
Number of moves is 1 and is the optimal solution