# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
473907 | Ahmed57 | Euklid (COCI20_euklid) | C++14 | 119 ms | 292 KiB |
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;
long long r(long long a,long long b){
if(a<b)return r(b,a);
else if(a>=b&&b>1)return r(abs(a/b),b);
else if(a>=b&&b==1)return a;
}
int main(){
//ios_base::sync_with_stdio(false);cin.tie(NULL);
int t;cin>>t;
z:while(t--){
long long a,b;
cin>>a>>b;
for(int i = 1;i<300;i++){
for(int j = 1;j<300;j++){
if(__gcd(i,j)==a&&r(i,j)==b){
cout<<i<<" "<<j<<"\n";
goto z;
}
}
}
}
return 0;
}
Compilation message (stderr)
# | 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... |