/ SeriousOJ /

Record Detail

Wrong Answer


  
# Status Time Cost Memory Cost
#1 Wrong Answer 21ms 2.934 MiB
#2 Wrong Answer 22ms 3.027 MiB

Code

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def min_operations_to_zero(A, B):
    gcd_value = gcd(A, B)
    return (A + B) // gcd_value

def main():
    T = int(input())
    for _ in range(T):
        A, B = map(int, input().split())
        result = min_operations_to_zero(A, B)
        print(result)

if __name__ == "__main__":
    main()

Information

Submit By
Type
Submission
Problem
P1029 Make it zero
Contest
Brain booster #2
Language
Python 3 (Python 3.12.3)
Submit At
2024-03-06 16:46:08
Judged At
2024-11-11 03:41:12
Judged By
Score
0
Total Time
22ms
Peak Memory
3.027 MiB