# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
854490 | vjudge1 | Euklid (COCI20_euklid) | C++17 | 402 ms | 460 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.
#ifndef Local
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#endif
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define lim 100000
using namespace std;
const int mod=1000000007ll;
int res(int i,int j){
if(i<j)return res(j,i);
if(j==1)return i;
//cerr<<i<<" "<<j<<"\n";
return res(i/j,j);
}
void solve(){
int g,h;
cin>>g>>h;
for(int j=1;1;j++){
int a=(j*h+1);
if(__gcd(a,j)==1&&res(a*g,j*g)==h){
cout<<a*g<<" "<<j*g<<"\n";
return;
}
}
/*
if(h<=g){
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... |