Accepted
Code
def gcd(a, b):
if b == 0:
return a
return gcd(b, a % b)
def print_fraction(a, u):
g = gcd(a, u)
x = u // g
y = a // g
print(str(x) + " / " + str(y))
G = int(input())
for i in range(G):
A, U = map(int, input().split())
print("Game #" + str(i + 1) + ": ", end="")
print_fraction(A, U)
Information
- Submit By
- Type
- Submission
- Problem
- P1001 Achievement-Unlocked
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-01-09 14:16:12
- Judged At
- 2024-11-11 03:43:38
- Judged By
- Score
- 100
- Total Time
- 16ms
- Peak Memory
- 3.129 MiB