纯一个SB题,要最小的,那输进去,输出来就行。
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
long long G,L,t;
cin>>t;
while(t--)
{ cin>>G>>L;
if(L%G) cout<<-1<<endl;
else cout<<G<<" "<<L<<endl;
}
return 0;
}
纯一个SB题,要最小的,那输进去,输出来就行。
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
long long G,L,t;
cin>>t;
while(t--)
{ cin>>G>>L;
if(L%G) cout<<-1<<endl;
else cout<<G<<" "<<L<<endl;
}
return 0;
}