Submission #1077900

#TimeUsernameProblemLanguageResultExecution timeMemory
1077900dostsEuklid (COCI20_euklid)C++17
0 / 110
1 ms604 KiB
//Dost SEFEROĞLU #include <bits/stdc++.h> using namespace std; #define int long long #define pii pair<int,int> #define ff first #define ss second #define sp << " " << #define all(cont) cont.begin(),cont.end() #define vi vector<int> const int MOD = 1e9+7,inf = 2e18; const int N = 5001; int f(int a,int b) { if (a < b) swap(a,b); if (b == 1) return a; return f(a/b,b); } void solve() { int g,h; cin >> g >> h; int k = (h*h+g-1)/g; assert(f(h*g*k,g*k) == h); cout << h*g*k sp g*k << endl; } signed main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); #ifdef Dodi freopen("in.txt","r",stdin); freopen("out.txt","w",stdout); #endif int t = 1; //cin >> t; while (t --> 0) solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...