Submission details
Task:Peli
Sender:Nyno
Submission time:2026-10-22 17:15:38 +0300
Language:C++ (C++17)
Status:READY
Result:100
Feedback
subtaskverdictscore
#1ACCEPTED17
#2ACCEPTED38
#3ACCEPTED45
Test results
testverdicttimesubtask
#1ACCEPTED0.00 s1, 2, 3details
#2ACCEPTED0.00 s1, 2, 3details
#3ACCEPTED0.01 s2, 3details
#4ACCEPTED0.01 s3details
#5ACCEPTED0.01 s2, 3details
#6ACCEPTED0.01 s3details

Code

#include <bits/stdc++.h>
using namespace std;

int main() {
    int t;
    cin >> t;

    while (t--) {
        long long a, b;
        cin >> a >> b;

        if (a > b) swap(a, b);

        long long k = b - a;
        long long x = floor(k * (1.0 + sqrt(5.0)) / 2.0);

        if (x == a)
            cout << "second\n";
        else
            cout << "first\n";
    }
}

Test details

Test 1 (public)

Subtask: 1, 2, 3

Verdict: ACCEPTED

input
5
2 2
1 2
3 2
4 3
...

correct output
first
second
first
first
second

user output
first
second
first
first
second

Test 2

Subtask: 1, 2, 3

Verdict: ACCEPTED

input
100
1 1
1 2
1 3
1 4
...

correct output
first
second
first
first
first
...

user output
first
second
first
first
first
...

Test 3

Subtask: 2, 3

Verdict: ACCEPTED

input
1000
82 14
91 84
13 97
92 23
...

correct output
first
first
first
first
first
...

user output
first
first
first
first
first
...

Test 4

Subtask: 3

Verdict: ACCEPTED

input
1000
1630 271
1812 1671
254 1938
1827 443
...

correct output
first
first
first
first
first
...

user output
first
first
first
first
first
...

Test 5

Subtask: 2, 3

Verdict: ACCEPTED

input
1000
36 14
79 81
93 82
32 1
...

correct output
first
first
first
first
first
...

user output
first
first
first
first
first
...

Test 6

Subtask: 3

Verdict: ACCEPTED

input
1000
486 300
899 1455
879 543
40 65
...

correct output
second
second
second
second
second
...

user output
second
second
second
second
second
...