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;
int R(int a, int b){
cout << a << ", " << b << '\n';
if(a < b)return R(b, a);
if(a >= b && b > 1)return R(a / b, b);
return a;
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while(t--){
int g, h;
cin >> g >> h;
if(h == 2){
cout << g << " " << 2 * g << '\n';
}
else if(g == h){
cout << g << " " << g << '\n';
}
else {
cout << (long long)h * h << " " << (long long)h * h * h << '\n';
}
}
}
# | 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... |