/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 19ms 2.965 MiB
#2 Wrong Answer 156ms 3.152 MiB

Code

for _ in range(int(input())):

    x , y = map(int, input().split())
    

    
    if x == 1 or y == 1 or x == 0 or y == 0:
        print("-1")
    else:
        flag = 1
        
        if x > y:
            for i in range(2,int((y**0.5)+1)):
                if x% i == 0 and y%i == 0:
                    
                    flag = 0
                    print(i)
                    break
                
        else:
            for i in range(2,int((x**0.5)+1)):
                if y% i == 0 and x%i == 0:
                        flag = 0
                        print(i)
                        break
                
            if flag == 1:
                print(-1)

    

Information

Submit By
Type
Submission
Problem
P1011 LCD
Contest
Brain booster - 1
Language
Python 3 (Python 3.12.3)
Submit At
2023-12-31 17:01:44
Judged At
2024-11-11 03:44:52
Judged By
Score
0
Total Time
156ms
Peak Memory
3.152 MiB