제출 #872249

#제출 시각아이디문제언어결과실행 시간메모리
872249IrateEuklid (COCI20_euklid)C++14
20 / 110
1 ms348 KiB
#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 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...