Accepted
Code
T = int(input())
results = []
for _ in range(T):
A, B = map(int, input().split())
operations = 0
while A != 0 and B != 0:
if A > B:
operations += A // B
A %= B
else:
operations += B // A
B %= A
results.append(str(operations))
print("\n".join(results))
Information
- Submit By
- Type
- Submission
- Problem
- P1029 Make it zero
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2024-11-05 21:26:20
- Judged At
- 2024-11-11 02:25:30
- Judged By
- Score
- 100
- Total Time
- 25ms
- Peak Memory
- 3.223 MiB