← Home
write a go solution for Description:
YouKn0wWho has two even integers x and y. Help him to find an integer n such that 1<=n<=2*10^18 and nbmodx=ybmodn. Here, abmodb denotes the remainder of a after division by b. If there are multiple such integers, output any. It can be shown that such an integer always exists under the given constraints.

Input Format:
The first line contains a single integer t (1<=t<=10^5)  — the number of test cases.

The first and only line of each test case contains two integers x and y (2<=x,y<=10^9, both are even).

Output Format:
For each test case, print a single integer n (1<=n<=2*10^18) that satisfies the condition mentioned in the statement. If there are multiple such integers, output any. It can be shown that such an integer always exists under the given constraints.

Note:
In the first test case, 4bmod4=8bmod4=0.

In the second test case, 10bmod4=2bmod10=2.

In the third test case, 420bmod420=420bmod420=0.. Output only the code with no comments, explanation, or additional text.