Colded LCM

Iftekhar_Hakim BUET Inter University Pro...
Limits 3s, 256 MB

Chris Martin is challenged with another problem. This time our favorite violinist Lindsey Stirling asked him to solve this problem. Lindsey will give Chris two integers LL and RR, such that L<RL \lt R. Chris has to find two integers aa and bb, such that La<bRL \le a \lt b \le R, where LCM of aa and bb is as minimum as possible. Print this minimum value of LCM.

By definition, LCM or Least Common Multiple of two integers xx and yy is the minimum positive integer divisible by both xx and yy.

Input

First line of the input will be an integer TT (1T2000)(1 \le T \le 2000), denoting number of testcases. Each of the next TT lines will contain two integers LL and RR (1L<R109)(1 \le L \lt R \le 10^9), denoting the numbers Lindsey gave to Chris in the corresponding testcase.

Output

For each testcase, print the answer in one line.

Sample

InputOutput
2
1 3
4 6
2
12

Submit

Login to submit.

Statistics

44% Solution Ratio
user.257439Earliest, 5d ago
MrBrionixFastest, 0.0s
MrBrionixLightest, 131 kB
ash_98Shortest, 635B
Toph uses cookies. By continuing you agree to our Cookie Policy.