제출 #872255

#제출 시각아이디문제언어결과실행 시간메모리
872255NotLinuxEuklid (COCI20_euklid)C++17
0 / 110
1 ms348 KiB
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
	int g,h;cin >> g >> h;
	int l = h , r = 2 * h - 1;
	while(true){
		if((l + (g - l%g)) <= r){
			int k = (l + (g - l%g)) / g;
			cout << g * k << " " << g * k * h << endl;
			return;
		}
		l *= h;
		r *= h;
	}
}
signed main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	int testcase = 1;cin >> testcase;
	while(testcase--)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...