LCM And GCD
Submissions: 10093   Accuracy:

51.82%

  Difficulty: Basic   Marks: 1
     

Given two numbers A and B. The task is to find out their LCM and GCD.

Input:
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.

Output:
For each testcase in a new line, print LCM and GCD separated by space.

Constraints:
1 <= T <= 100
1 <= a <= 10
1 <= b <= 1000

Example:
Input:
2

5 10
14 8

Output:
10 5
56 2

Explanation:
Testcase 1:
LCM and GCD of given numbers 5 and 10 are: 10 and 5.

** For More Input/Output Examples Use 'Expected Output' option **

Author: abhiraj26


Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.

to report an issue on this page.