This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
ll t;cin>>t;
while(t--){
ll g,h;cin>>g>>h;
for(ll i=0;i<=1e18;i++){
bool b=0;
for(ll j=0;j<=1e18;j++){
if(__gcd(i,j)==g && max(i,j)==h){
b=1;
cout<<i<<" "<<j<<endl;break;
}
}
if(b)break;
}
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |