Problem of the day
Input: 'X' = 2, ‘Y’=3
Output: "6"
As “6” is the smallest number that is divisible by both 2 and 3.
The first line will contain the integer 'T', denoting the number of test cases.
Each test case contains two space-separated integers ‘X’ and ‘Y’
For each test case, print the LCM of given integers ‘X’ and ‘Y’.
You don't need to print anything. It has already been taken care of. Just implement the given function.
1 <= 'T' <= 1000
1 <= ‘X’ , ‘Y’ <= 10^9
Time Limit: 1 sec
2
2 7
6 8
14
24
In test case ‘1’, before 8 to 13, all numbers are not divided by both ‘2’ and ‘7’ both. So ‘14’ is the smallest number divisible by both ‘2’ and ‘7’. So LCM of ‘2’ and ‘7’ is ‘14’.
In test case ‘2’, ‘24’ is the smallest number divisible by both ‘6’ and ‘8’ so the answer is ‘24’.
2
8 8
6 24
8
24