/ SeriousOJ /

Record Detail

Accepted


  
# Status Time Cost Memory Cost
#1 Accepted 14ms 3.074 MiB
#2 Accepted 21ms 3.02 MiB

Code

t=int(input())
for i in range(t):
	x,y=map(int,input().split())
	for k in range(1,101):
		if k%x!=0 and k%y!=0:
			print(k)
			break
	else:
		print(-1)

Information

Submit By
Type
Submission
Problem
P1235 A. Valid Integer
Contest
Happy New Year 2026
Language
Python 3 (Python 3.12.3)
Submit At
2026-01-06 14:36:53
Judged At
2026-01-06 14:36:53
Judged By
Score
100
Total Time
21ms
Peak Memory
3.074 MiB