이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
const int N = 1010, F = 1e9;
int main(){
cin.tie(0); ios::sync_with_stdio(0);
int t;
cin >> t;
while(t--){
ll g, h;
cin >> g >> h;
ll k = h;
ll b = g * ((g - 1 + k) / g);
while(b <= g){
k *= h;
b = g * ((g - 1 + k) / g);
}
cout << (b*h + g) << ' ' << b << '\n';
}
return 0;
}
# | 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... |