Code
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
ll t;
cin>>t;
for(int i=1; i<=t; i++){
ll a, b; cin>>a>>b;
ll d=__gcd(a,b);
ll x=a/d;
ll y=b/d;
if(x<y) cout<<"Game #"<<i<<": "<<x<<" / "<<y<<endl;
cout<<"Game #"<<i<<": "<<y<<" / "<<x<<endl;
}
return 0;
}
Information
- Submit By
- Type
- Pretest
- Problem
- P1001 Achievement-Unlocked
- Language
- C++17 (G++ 13.2.0)
- Submit At
- 2025-02-17 14:48:57
- Judged At
- 2025-02-17 14:48:57
- Judged By
- Score
- 10
- Total Time
- 4ms
- Peak Memory
- 532.0 KiB