CSES - Putka Open 2020 – 1/5 - Results
Submission details
Task:Pinot
Sender:elcaroak
Submission time:2020-09-04 18:48:32 +0300
Language:Python3 (CPython3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#1--1, 2details
#2--2details

Code

for _ in range(int(input())):
    c=0
    x,y = [int(x) for x in input().split()]
    while x>=0 and y>=0:
        if x<y:
            c+=x%y
            y=y-(x%y)*x
        elif x>y:
            c+=y%x
            x=x-(y%x)*y
        else:
            c+=1
            break
    print(c)

Test details

Test 1

Group: 1, 2

Verdict:

input
1000
5 90
19 86
66 28
10 47
...

correct output
18
15
9
10
16
...

user output
(empty)

Test 2

Group: 2

Verdict:

input
1000
1 936283842
56227247 73458046
364717918 449812461
158413382 363667122
...

correct output
936283842
167
116
59
158
...

user output
(empty)