Given two numbers A and B. The task is to find out their LCM and GCD.
The first line of input contains an integer T denoting the number of testcases. T testcases follow. In each test cases, there are two numbers A and B separated by space.
For each testcase in a new line, print LCM and GCD separated by space.
1 <= T <= 104
1 <= A <= 108
1 <= B <= 108
Testcase 1: LCM and GCD of given numbers 5 and 10 are: 10 and 5.
If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.