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.


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.


For each testcase, print the answer in one line.


1 3
4 6


Login to submit.


58% Solution Ratio
user.257439Earliest, 3M ago
nirjoy139Fastest, 0.0s
naeem4265Lightest, 5.5 kB
phe0nixShortest, 399B
Toph uses cookies. By continuing you agree to our Cookie Policy.