GCD LCM#1148

GCD LCM

1 saniye
64 megabayt
Çok kolay

The GCD of two positive integers is the largest integer that divides both numbers without remainder. The LCM of two positive integers is the smallest positive integer that is divisible by both numbers. A positive integer can be the GCD or the LCM of many pairs of numbers. In this problem, you are given two positive integers, where the first is the required GCD and the second is the required LCM.

Giriş

The first line contains a positive integer , the number of test cases (T \leq 100). Each of the next lines contains two positive integers and . It is guaranteed that and are less than 2^{31}.

Çıktı

For each test case, print one line containing two positive integers and (a \leq b), such that their GCD is and their LCM is . If there are multiple answers, print the pair with the minimal . If there is no such pair, print -1.

Örnekler

Örnek 1

Loading
Loading