Time Exceeded
Code
T = int(input())
report = []
for _ in range(T):
N, M = map(int, input().split())
sign = True
for i in range(2, max(N, M)+1):
if N % i == 0 and M % i == 0:
report.append(i)
sign = False
break
if sign:
report.append(-1)
[print(i) for i in report]
Information
- Submit By
- Type
- Submission
- Problem
- P1011 LCD
- Contest
- Brain booster - 1
- Language
- Python 3 (Python 3.12.3)
- Submit At
- 2023-12-31 15:02:13
- Judged At
- 2024-11-11 03:46:02
- Judged By
- Score
- 50
- Total Time
- ≥3088ms
- Peak Memory
- ≥3.527 MiB