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>
#pragma loop-opt(on)
#pragma GCC optmize("Ofast")
#define print(x) cout << #x <<" = " << x << endl
#define pprint(x) cout << #x <<" = (" << x.first << " , " << x.second <<" )\n"
#define rep(i, a, b) for(int i = a; i <= b; i++)
#define rrep(i, a, b) for(int i = b; i >= a; i--)
#define ceil(a, b) ((a + b - 1) / b)
#define all(x) x.begin(), x.end()
#define MAXN 1000005
#define INF 1000000000000000000
#define MOD 1000000007
#define eps (1e-9)
#define int long long int
#define lld long double
#define pii pair<int, int>
#define random mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count())
using namespace std;
int t, g, h, a, b;
signed main() {
ios::sync_with_stdio(false), cin.tie(0);
cin >> t;
while(t--) {
cin >> g >> h;
b = g * ceil(h, g), a = b * h + g;
cout << a <<" " << b <<"\n";
}
return 0;
}
Compilation message (stderr)
euklid.cpp:2: warning: ignoring #pragma loop [-Wunknown-pragmas]
2 | #pragma loop-opt(on)
|
euklid.cpp:3: warning: ignoring #pragma GCC optmize [-Wunknown-pragmas]
3 | #pragma GCC optmize("Ofast")
|
# | 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... |