CSES - Putka Open 2020 – 1/5 - Results
Submission details
Task:Pinot
Sender:TapaniS
Submission time:2020-09-04 21:45:23 +0300
Language:Java
Status:READY
Result:23
Feedback
groupverdictscore
#1ACCEPTED23
#20
Test results
testverdicttimegroup
#1ACCEPTED0.22 s1, 2details
#2--2details

Code

import java.util.*;

public class pinot {

    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);

        int qty = input.nextInt();

        int[] a = new int[qty];
        int[] b = new int[qty];
		int[] ans = new int[qty];

        for (int i = 0; i < qty; i++) {
           a[i] = input.nextInt();
           b[i] = input.nextInt();
		}

		int test = 1;
		int a1 = 1;
		int b1 = 1;

        for (int i = 0; i < qty; i++) {
			ans[i] = 0;
			a1 = a[i];
			b1 = b[i];

			while (a1 * b1 > 0) {
				ans[i] += 1;
				if (a1 > b1) a1 = a1 - b1;
				else if (b1 > a1) b1 = b1 - a1;
				else a1 = 0;
			}

			System.out.println(ans[i]);
		}
		input.close(); 
    }
}

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

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

correct output
18
15
9
10
16
...

user output
18
15
9
10
16
...

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)