#P1389A. LCM Problem
LCM Problem
Description
Let be the minimum positive integer that is divisible by both and . For example, , .
You are given two integers and . Find two integers and such that and .
The first line contains one integer () — the number of test cases.
Each test case is represented by one line containing two integers and ().
For each test case, print two integers:
- if it is impossible to find integers and meeting the constraints in the statement, print two integers equal to ;
- otherwise, print the values of and (if there are multiple valid answers, you may print any of them).
Input
The first line contains one integer () — the number of test cases.
Each test case is represented by one line containing two integers and ().
Output
For each test case, print two integers:
- if it is impossible to find integers and meeting the constraints in the statement, print two integers equal to ;
- otherwise, print the values of and (if there are multiple valid answers, you may print any of them).