Posted by: dzikrina on: October 23, 2010
//http://uva.onlinejudge.org/external/113/11388.html
//http://github.com/andmej/acm/tree/master/11388%20-%20GCD%20LCM
//11388 PROBLEM d: gcd lcm
#include
using namespace std;
int main()
{
int t;
unsigned int g, l;
cin >> t;
while (t--)
{
cin >> g >> l;
if ( g > l || l % g != 0)
cout << "-1" << endl;
else
cout << g << " " << l << endl;
}
//system ("pause");
return 0;
}
Recent Comments