QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#449554#8595. Точки на прямiйbashkort#100 ✓48ms3896kbC++20786b2024-06-21 14:16:512024-06-21 14:16:51

Judging History

你现在查看的是最新测评结果

  • [2024-06-21 14:16:51]
  • 评测
  • 测评结果:100
  • 用时:48ms
  • 内存:3896kb
  • [2024-06-21 14:16:51]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    auto query = [&](int i, int j, int k) {
        cout << "? " << i << " " << j << " " << k << endl;
        int r;
        cin >> r;
        return r;
    };

    mt19937 rnd(228);
    vector<int> a(n);
    iota(a.begin(), a.end(), 1);
    shuffle(a.begin(), a.end(), rnd);
    int x = a[0], y = a[1];
    for (int i = 2; i < n; ++i) {
        int z = a[i];
        if (query(x, y, z)) {
            continue;
        }
        if (query(z, y, x)) {
            x = z;
        } else {
            y = z;
        }
    }
    cout << "! " << x << " " << y << '\n';

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 17
Accepted

Test #1:

score: 17
Accepted
time: 1ms
memory: 3580kb

input:

3
1

output:

? 2 1 3
! 2 1

result:

ok ok, 1 queries used

Test #2:

score: 0
Accepted
time: 1ms
memory: 3460kb

input:

3
0
0

output:

? 2 1 3
? 3 1 2
! 2 3

result:

ok ok, 2 queries used

Test #3:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

4
0
0
0
0

output:

? 3 1 4
? 4 1 3
? 3 4 2
? 2 4 3
! 3 2

result:

ok ok, 4 queries used

Test #4:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

20
1
0
1
1
0
1
1
0
1
0
0
1
0
1
1
1
0
1
1
1
1
1
1
1

output:

? 20 10 8
? 20 10 2
? 2 10 20
? 2 10 13
? 2 10 15
? 15 10 2
? 15 10 14
? 15 10 17
? 17 10 15
? 17 10 18
? 18 10 17
? 17 18 19
? 17 18 11
? 11 18 17
? 11 18 5
? 11 18 6
? 11 18 9
? 9 18 11
? 9 18 4
? 9 18 3
? 9 18 7
? 9 18 12
? 9 18 1
? 9 18 16
! 9 18

result:

ok ok, 24 queries used

Test #5:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

20
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 20 10 8
? 20 10 2
? 20 10 13
? 20 10 15
? 20 10 14
? 20 10 17
? 20 10 18
? 20 10 19
? 20 10 11
? 20 10 5
? 20 10 6
? 20 10 9
? 20 10 4
? 20 10 3
? 20 10 7
? 20 10 12
? 20 10 1
? 20 10 16
! 20 10

result:

ok ok, 18 queries used

Test #6:

score: 0
Accepted
time: 1ms
memory: 3784kb

input:

20
1
1
1
0
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1

output:

? 20 10 8
? 20 10 2
? 20 10 13
? 20 10 15
? 15 10 20
? 20 15 14
? 20 15 17
? 20 15 18
? 20 15 19
? 19 15 20
? 20 19 11
? 20 19 5
? 20 19 6
? 20 19 9
? 20 19 4
? 20 19 3
? 20 19 7
? 20 19 12
? 20 19 1
? 20 19 16
! 20 19

result:

ok ok, 20 queries used

Test #7:

score: 0
Accepted
time: 1ms
memory: 3480kb

input:

20
0
1
0
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
0
0
1

output:

? 20 10 8
? 8 10 20
? 8 10 2
? 2 10 8
? 8 2 13
? 8 2 15
? 8 2 14
? 8 2 17
? 8 2 18
? 8 2 19
? 8 2 11
? 8 2 5
? 5 2 8
? 5 2 6
? 5 2 9
? 5 2 4
? 4 2 5
? 4 2 3
? 4 2 7
? 4 2 12
? 4 2 1
? 1 2 4
? 4 1 16
! 4 1

result:

ok ok, 23 queries used

Test #8:

score: 0
Accepted
time: 1ms
memory: 3596kb

input:

20
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 20 10 8
? 8 10 20
? 20 8 2
? 2 8 20
? 20 2 13
? 20 2 15
? 20 2 14
? 20 2 17
? 20 2 18
? 20 2 19
? 20 2 11
? 20 2 5
? 20 2 6
? 20 2 9
? 20 2 4
? 20 2 3
? 20 2 7
? 20 2 12
? 20 2 1
? 20 2 16
! 20 2

result:

ok ok, 20 queries used

Test #9:

score: 0
Accepted
time: 1ms
memory: 3808kb

input:

20
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1

output:

? 20 10 8
? 8 10 20
? 20 8 2
? 2 8 20
? 20 2 13
? 20 2 15
? 20 2 14
? 20 2 17
? 20 2 18
? 20 2 19
? 20 2 11
? 20 2 5
? 20 2 6
? 20 2 9
? 20 2 4
? 20 2 3
? 20 2 7
? 20 2 12
? 20 2 1
? 1 2 20
? 20 1 16
! 20 1

result:

ok ok, 21 queries used

Test #10:

score: 0
Accepted
time: 1ms
memory: 3752kb

input:

20
0
0
0
0
1
1
1
0
0
1
0
0
1
1
1
1
1
1
1
1
1
1

output:

? 20 10 8
? 8 10 20
? 20 8 2
? 2 8 20
? 20 2 13
? 20 2 15
? 20 2 14
? 20 2 17
? 17 2 20
? 20 17 18
? 20 17 19
? 19 17 20
? 20 19 11
? 20 19 5
? 20 19 6
? 20 19 9
? 20 19 4
? 20 19 3
? 20 19 7
? 20 19 12
? 20 19 1
? 20 19 16
! 20 19

result:

ok ok, 22 queries used

Test #11:

score: 0
Accepted
time: 1ms
memory: 3524kb

input:

20
0
0
0
0
1
1
0
1
1
1
1
0
1
1
0
1
1
1
0
1
1
1
0
0
1

output:

? 20 10 8
? 8 10 20
? 20 8 2
? 2 8 20
? 20 2 13
? 20 2 15
? 20 2 14
? 14 2 20
? 14 2 17
? 14 2 18
? 14 2 19
? 14 2 11
? 11 2 14
? 11 2 5
? 11 2 6
? 6 2 11
? 6 2 9
? 6 2 4
? 6 2 3
? 3 2 6
? 3 2 7
? 3 2 12
? 3 2 1
? 1 2 3
? 3 1 16
! 3 1

result:

ok ok, 25 queries used

Test #12:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

20
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
0

output:

? 20 10 8
? 20 10 2
? 20 10 13
? 20 10 15
? 20 10 14
? 20 10 17
? 20 10 18
? 20 10 19
? 20 10 11
? 11 10 20
? 20 11 5
? 20 11 6
? 20 11 9
? 20 11 4
? 20 11 3
? 20 11 7
? 20 11 12
? 20 11 1
? 20 11 16
? 16 11 20
! 20 16

result:

ok ok, 20 queries used

Test #13:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

20
0
0
0
0
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1

output:

? 20 10 8
? 8 10 20
? 20 8 2
? 2 8 20
? 20 2 13
? 20 2 15
? 20 2 14
? 20 2 17
? 17 2 20
? 17 2 18
? 17 2 19
? 17 2 11
? 17 2 5
? 17 2 6
? 17 2 9
? 17 2 4
? 4 2 17
? 4 2 3
? 4 2 7
? 4 2 12
? 4 2 1
? 1 2 4
? 1 2 16
! 1 2

result:

ok ok, 23 queries used

Subtask #2:

score: 16
Accepted

Test #14:

score: 16
Accepted
time: 0ms
memory: 3612kb

input:

100
0
1
0
0
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 51 62 77
? 77 62 51
? 51 77 46
? 46 77 51
? 46 77 84
? 46 77 65
? 46 77 100
? 46 77 26
? 26 77 46
? 26 77 56
? 26 77 11
? 26 77 87
? 26 77 21
? 26 77 95
? 26 77 79
? 26 77 99
? 26 77 58
? 26 77 88
? 26 77 1
? 26 77 27
? 26 77 81
? 26 77 74
? 26 77 91
? 91 77 26
? 91 77 90
? 9...

result:

ok ok, 106 queries used

Test #15:

score: 0
Accepted
time: 1ms
memory: 3828kb

input:

100
0
0
1
1
1
1
1
0
1
1
1
1
1
0
1
0
1
1
1
1
1
1
1
0
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 63 51 46
? 63 51 84
? 63 51 65
? 63 51 100
? 63 51 26
? 26 51 63
? 26 51 56
? 26 51 11
? 26 51 87
? 26 51 21
? 26 51 95
? 95 51 26
? 95 51 79
? 79 51 95
? 79 51 99
? 79 51 58
? 79 51 88
? 79 51 1
? 79 51 27
? 79 51 81
? 79 51 74
? 74 51 79
? 74 51 91
? 91 51 74
? 7...

result:

ok ok, 106 queries used

Test #16:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

100
0
0
0
1
1
1
0
0
1
0
1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 77 51 46
? 77 51 84
? 77 51 65
? 65 51 77
? 77 65 100
? 77 65 26
? 26 65 77
? 26 65 56
? 26 65 11
? 26 65 87
? 26 65 21
? 21 65 26
? 21 65 95
? 21 65 79
? 21 65 99
? 99 65 21
? 99 65 58
? 99 65 88
? 88 65 99
? 88 65 1
? 88 65 27
? 88 65 81
? 88 65 74
? 7...

result:

ok ok, 109 queries used

Test #17:

score: 0
Accepted
time: 1ms
memory: 3584kb

input:

100
0
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 63 77 46
? 63 77 84
? 63 77 65
? 63 77 100
? 100 77 63
? 63 100 26
? 63 100 56
? 63 100 11
? 63 100 87
? 63 100 21
? 63 100 95
? 63 100 79
? 63 100 99
? 63 100 58
? 63 100 88
? 88 100 63
? 63 88 1
? 63 88 27
? 63 88 81
? 81 88 63
? 63 81 74
? 63 81 91
? ...

result:

ok ok, 104 queries used

Test #18:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

100
1
0
1
1
0
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 63 62 77
? 77 62 63
? 77 62 46
? 77 62 84
? 84 62 77
? 84 62 65
? 65 62 84
? 84 65 100
? 84 65 26
? 26 65 84
? 26 65 56
? 26 65 11
? 26 65 87
? 26 65 21
? 26 65 95
? 26 65 79
? 26 65 99
? 26 65 58
? 26 65 88
? 26 65 1
? 26 65 27
? 26 65 81
? 26 65 74
? 26 65 91
? 26 65 90
? 26 65 48
? 2...

result:

ok ok, 102 queries used

Test #19:

score: 0
Accepted
time: 1ms
memory: 3520kb

input:

100
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 51 62 77
? 77 62 51
? 51 77 46
? 51 77 84
? 51 77 65
? 51 77 100
? 51 77 26
? 51 77 56
? 51 77 11
? 51 77 87
? 51 77 21
? 51 77 95
? 51 77 79
? 51 77 99
? 51 77 58
? 51 77 88
? 88 77 51
? 88 77 1
? 88 77 27
? 88 77 81
? 88 77 74
? 88 77 91
? 88 77 90
? 88 77 48
? 88 77 80
? 8...

result:

ok ok, 104 queries used

Test #20:

score: 0
Accepted
time: 1ms
memory: 3528kb

input:

100
1
0
1
1
0
1
0
0
0
0
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1

output:

? 63 62 51
? 63 62 77
? 77 62 63
? 77 62 46
? 77 62 84
? 84 62 77
? 84 62 65
? 65 62 84
? 84 65 100
? 100 65 84
? 84 100 26
? 84 100 56
? 84 100 11
? 84 100 87
? 87 100 84
? 87 100 21
? 87 100 95
? 95 100 87
? 95 100 79
? 95 100 99
? 95 100 58
? 95 100 88
? 95 100 1
? 95 100 27
? 95 100 81
? 95 100 ...

result:

ok ok, 105 queries used

Test #21:

score: 0
Accepted
time: 1ms
memory: 3608kb

input:

100
0
0
0
1
0
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 77 51 46
? 46 51 77
? 46 51 84
? 46 51 65
? 46 51 100
? 46 51 26
? 26 51 46
? 26 51 56
? 26 51 11
? 11 51 26
? 11 51 87
? 11 51 21
? 11 51 95
? 11 51 79
? 11 51 99
? 11 51 58
? 11 51 88
? 11 51 1
? 1 51 11
? 11 1 27
? 11 1 81
? 11 1 74
? 11 1 91
? 11 1 9...

result:

ok ok, 107 queries used

Test #22:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

100
0
0
0
1
0
0
0
1
1
0
1
0
0
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 77 51 46
? 46 51 77
? 77 46 84
? 84 46 77
? 84 46 65
? 84 46 100
? 100 46 84
? 100 46 26
? 26 46 100
? 100 26 56
? 100 26 11
? 11 26 100
? 100 11 87
? 100 11 21
? 100 11 95
? 100 11 79
? 100 11 99
? 100 11 58
? 100 11 88
? 100 11 1
? 1 11 100
? 100 1 27
...

result:

ok ok, 107 queries used

Test #23:

score: 0
Accepted
time: 1ms
memory: 3540kb

input:

100
0
0
0
1
0
0
0
1
1
0
1
0
0
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 77 51 46
? 46 51 77
? 77 46 84
? 84 46 77
? 84 46 65
? 84 46 100
? 100 46 84
? 100 46 26
? 26 46 100
? 100 26 56
? 100 26 11
? 11 26 100
? 100 11 87
? 100 11 21
? 100 11 95
? 100 11 79
? 100 11 99
? 100 11 58
? 100 11 88
? 100 11 1
? 1 11 100
? 100 1 27
...

result:

ok ok, 106 queries used

Test #24:

score: 0
Accepted
time: 1ms
memory: 3620kb

input:

100
1
0
0
1
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 63 62 77
? 77 62 63
? 63 77 46
? 63 77 84
? 84 77 63
? 84 77 65
? 84 77 100
? 100 77 84
? 84 100 26
? 84 100 56
? 84 100 11
? 84 100 87
? 84 100 21
? 84 100 95
? 84 100 79
? 84 100 99
? 84 100 58
? 84 100 88
? 84 100 1
? 84 100 27
? 84 100 81
? 84 100 74
? 84 100 91
? 84 100 90
? 90 100...

result:

ok ok, 102 queries used

Test #25:

score: 0
Accepted
time: 1ms
memory: 3744kb

input:

100
0
0
0
1
0
0
1
1
1
0
1
1
0
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 63 51 77
? 77 51 63
? 77 51 46
? 46 51 77
? 77 46 84
? 77 46 65
? 77 46 100
? 77 46 26
? 26 46 77
? 26 46 56
? 26 46 11
? 11 46 26
? 26 11 87
? 26 11 21
? 26 11 95
? 26 11 79
? 26 11 99
? 26 11 58
? 26 11 88
? 26 11 1
? 1 11 26
? 1 11 27
? 1 11 81
? 1 11 74
? 1 11 91
? 1 11 9...

result:

ok ok, 106 queries used

Test #26:

score: 0
Accepted
time: 0ms
memory: 3784kb

input:

100
1
0
1
1
0
1
1
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 63 62 77
? 77 62 63
? 77 62 46
? 77 62 84
? 84 62 77
? 84 62 65
? 84 62 100
? 100 62 84
? 100 62 26
? 100 62 56
? 100 62 11
? 100 62 87
? 100 62 21
? 100 62 95
? 100 62 79
? 79 62 100
? 100 79 99
? 100 79 58
? 100 79 88
? 100 79 1
? 100 79 27
? 100 79 81
? 100 79 74
? 100 79 91
? 91 79 ...

result:

ok ok, 104 queries used

Test #27:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

100
0
1
1
0
1
1
1
1
0
1
1
0
1
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 63 62 51
? 51 62 63
? 51 62 77
? 51 62 46
? 46 62 51
? 46 62 84
? 46 62 65
? 46 62 100
? 46 62 26
? 26 62 46
? 26 62 56
? 26 62 11
? 11 62 26
? 11 62 87
? 11 62 21
? 21 62 11
? 11 21 95
? 11 21 79
? 11 21 99
? 11 21 58
? 11 21 88
? 11 21 1
? 1 21 11
? 1 21 27
? 1 21 81
? 1 21 74
? 1 21 91
? 1 21 9...

result:

ok ok, 107 queries used

Subtask #3:

score: 30
Accepted

Test #28:

score: 30
Accepted
time: 10ms
memory: 3564kb

input:

10000
0
0
1
1
1
0
1
0
0
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 3901 9936 5061
? 3901 9936 1625
? 3901 9936 8006
? 3901 9936 4543
? 4543 9936 3901
? 4543 9936 554
? 554 9936 4543
? 4543 554 474
? 4543 554 1539
? 4543 554 8927
? 4543 554 6112
? 4543 554 2826
? 2826 554 4543
? 4543 2826 9154
? 4543 2826 2619
? 2619 2826 4543
? 2...

result:

ok ok, 10013 queries used

Test #29:

score: 0
Accepted
time: 14ms
memory: 3588kb

input:

10000
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 5061 1079 9936
? 9936 5061 1625
? 9936 5061 8006
? 9936 5061 4543
? 9936 5061 554
? 9936 5061 474
? 9936 5061 1539
? 9936 5061 8927
? 9936 5061 6112
? 9936 5061 2826
? 9936 5061 9154
? 9936 5061 2619
? 9936 5061 1962
? 9936 5061 1819
? 9936 5061 3...

result:

ok ok, 10014 queries used

Test #30:

score: 0
Accepted
time: 8ms
memory: 3632kb

input:

10000
1
1
0
0
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 3901 1079 5061
? 3901 1079 1625
? 1625 1079 3901
? 3901 1625 8006
? 3901 1625 4543
? 4543 1625 3901
? 4543 1625 554
? 4543 1625 474
? 4543 1625 1539
? 4543 1625 8927
? 4543 1625 6112
? 4543 1625 2826
? 4543 1625 9154
? 9154 1625 4543
? 9154 1625 2619
? 9154 1625 1962
? 9154 1625 1...

result:

ok ok, 10014 queries used

Test #31:

score: 0
Accepted
time: 0ms
memory: 3624kb

input:

10000
0
1
1
1
1
1
1
1
1
0
0
1
1
1
0
0
1
1
0
1
0
0
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 9936 1079 8006
? 9936 1079 4543
? 9936 1079 554
? 9936 1079 474
? 9936 1079 1539
? 9936 1079 8927
? 8927 1079 9936
? 9936 8927 6112
? 9936 8927 2826
? 9936 8927 9154
? 9936 8927 2619
? 2619 8927 9936
? 9936 2619 1962
? 9936 2619 1...

result:

ok ok, 10020 queries used

Test #32:

score: 0
Accepted
time: 25ms
memory: 3564kb

input:

10000
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 3901 9936 5061
? 3901 9936 1625
? 3901 9936 8006
? 3901 9936 4543
? 3901 9936 554
? 3901 9936 474
? 3901 9936 1539
? 3901 9936 8927
? 3901 9936 6112
? 3901 9936 2826
? 2826 9936 3901
? 2826 9936 9154
? 2826 9936 2619
? 2826 9936 1962
? 1962 9936 2826
? 2826 1962 1...

result:

ok ok, 10009 queries used

Test #33:

score: 0
Accepted
time: 3ms
memory: 3804kb

input:

10000
0
0
1
0
0
0
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 3901 9936 5061
? 3901 9936 1625
? 1625 9936 3901
? 3901 1625 8006
? 8006 1625 3901
? 8006 1625 4543
? 4543 1625 8006
? 8006 4543 554
? 8006 4543 474
? 8006 4543 1539
? 8006 4543 8927
? 8006 4543 6112
? 8006 4543 2826
? 8006 4543 9154
? 8006 4543 2619
? 8006 4543 1...

result:

ok ok, 10013 queries used

Test #34:

score: 0
Accepted
time: 12ms
memory: 3644kb

input:

10000
0
0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 3901 9936 5061
? 5061 9936 3901
? 5061 9936 1625
? 5061 9936 8006
? 8006 9936 5061
? 8006 9936 4543
? 8006 9936 554
? 8006 9936 474
? 8006 9936 1539
? 8006 9936 8927
? 8006 9936 6112
? 8006 9936 2826
? 8006 9936 9154
? 8006 9936 2619
? 8006 9936 1962
? 8006 9936 1...

result:

ok ok, 10015 queries used

Test #35:

score: 0
Accepted
time: 12ms
memory: 3656kb

input:

10000
0
1
1
1
1
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 9936 1079 8006
? 9936 1079 4543
? 4543 1079 9936
? 4543 1079 554
? 554 1079 4543
? 4543 554 474
? 474 554 4543
? 4543 474 1539
? 1539 474 4543
? 1539 474 8927
? 1539 474 6112
? 1539 474 2826
? 1539 474 9154
? 1539 474 2619
? 1539 ...

result:

ok ok, 10018 queries used

Test #36:

score: 0
Accepted
time: 29ms
memory: 3864kb

input:

10000
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 9936 1079 8006
? 9936 1079 4543
? 9936 1079 554
? 554 1079 9936
? 9936 554 474
? 474 554 9936
? 9936 474 1539
? 9936 474 8927
? 9936 474 6112
? 9936 474 2826
? 9936 474 9154
? 9936 474 2619
? 9936 474 1962
? 9936 474 1819
? 9936 4...

result:

ok ok, 10013 queries used

Test #37:

score: 0
Accepted
time: 6ms
memory: 3788kb

input:

10000
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 9936 1079 8006
? 9936 1079 4543
? 9936 1079 554
? 554 1079 9936
? 9936 554 474
? 474 554 9936
? 9936 474 1539
? 9936 474 8927
? 9936 474 6112
? 9936 474 2826
? 9936 474 9154
? 9936 474 2619
? 9936 474 1962
? 9936 474 1819
? 9936 4...

result:

ok ok, 10014 queries used

Test #38:

score: 0
Accepted
time: 9ms
memory: 3632kb

input:

10000
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 1625 1079 9936
? 9936 1625 8006
? 8006 1625 9936
? 9936 8006 4543
? 9936 8006 554
? 9936 8006 474
? 9936 8006 1539
? 9936 8006 8927
? 9936 8006 6112
? 9936 8006 2826
? 9936 8006 9154
? 9936 8006 2619
? 9936 8006 1962
? 9936 8006 1...

result:

ok ok, 10011 queries used

Test #39:

score: 0
Accepted
time: 13ms
memory: 3520kb

input:

10000
1
1
1
1
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 8006
? 3901 1079 4543
? 3901 1079 554
? 554 1079 3901
? 554 1079 474
? 474 1079 554
? 474 1079 1539
? 474 1079 8927
? 474 1079 6112
? 474 1079 2826
? 474 1079 9154
? 474 1079 2619
? 474 1079 1962
? 474 1079 1819
? 474 1079 3646
? 474 107...

result:

ok ok, 10013 queries used

Test #40:

score: 0
Accepted
time: 11ms
memory: 3584kb

input:

10000
0
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 9936 1079 1625
? 9936 1079 8006
? 9936 1079 4543
? 9936 1079 554
? 9936 1079 474
? 9936 1079 1539
? 9936 1079 8927
? 9936 1079 6112
? 9936 1079 2826
? 2826 1079 9936
? 9936 2826 9154
? 9154 2826 9936
? 9936 9154 2619
? 9936 9154 1962
? 9936 9154 1...

result:

ok ok, 10009 queries used

Test #41:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

10000
0
1
0
1
0
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 9936
? 9936 1079 3901
? 9936 1079 5061
? 5061 1079 9936
? 5061 1079 1625
? 1625 1079 5061
? 1625 1079 8006
? 1625 1079 4543
? 1625 1079 554
? 554 1079 1625
? 1625 554 474
? 474 554 1625
? 1625 474 1539
? 1625 474 8927
? 1625 474 6112
? 1625 474 2826
? 1625 474 9154
? 1625 474 2619
? 1625...

result:

ok ok, 10016 queries used

Subtask #4:

score: 23
Accepted

Test #42:

score: 23
Accepted
time: 30ms
memory: 3564kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19998 queries used

Test #43:

score: 0
Accepted
time: 17ms
memory: 3864kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #44:

score: 0
Accepted
time: 10ms
memory: 3672kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #45:

score: 0
Accepted
time: 23ms
memory: 3896kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #46:

score: 0
Accepted
time: 14ms
memory: 3696kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #47:

score: 0
Accepted
time: 19ms
memory: 3616kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #48:

score: 0
Accepted
time: 27ms
memory: 3632kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #49:

score: 0
Accepted
time: 11ms
memory: 3608kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19999 queries used

Test #50:

score: 0
Accepted
time: 5ms
memory: 3676kb

input:

20000
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 10830 1079 13493
? 10830 1079 554
? 10830 1079 474
? 10830 1079 12197
? 10830 1079 8927
? 10830 1079 6112
? 10830 1079 12916
? 10830 1079 9154
? 10830 1079 10108
? 10830 1079 19554
? 10830 1079 17949
? 10830...

result:

ok ok, 19999 queries used

Test #51:

score: 0
Accepted
time: 18ms
memory: 3676kb

input:

20000
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 3901 1079 554
? 3901 1079 474
? 3901 1079 12197
? 3901 1079 8927
? 3901 1079 6112
? 3901 1079 12916
? 3901 1079 9154
? 3901 1079 10108
? 3901 1079 19554
? 3901 1079 17949
? 3901 1079 3646
? 3901 1079 7979
? 390...

result:

ok ok, 19998 queries used

Test #52:

score: 0
Accepted
time: 37ms
memory: 3616kb

input:

20000
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 5061 1079 3901
? 5061 1079 1625
? 5061 1079 19809
? 5061 1079 13493
? 5061 1079 554
? 5061 1079 474
? 5061 1079 12197
? 5061 1079 8927
? 5061 1079 6112
? 5061 1079 12916
? 5061 1079 9154
? 5061 1079 10108
? 5061 1079 19554
? 5061 1079 17949
? 5061 1079 3646
? 506...

result:

ok ok, 19999 queries used

Test #53:

score: 0
Accepted
time: 9ms
memory: 3672kb

input:

20000
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 10830 1079 13493
? 10830 1079 554
? 10830 1079 474
? 10830 1079 12197
? 10830 1079 8927
? 10830 1079 6112
? 10830 1079 12916
? 10830 1079 9154
? 10830 1079 10108
? 10830 1079 19554
? 10830 1079 17949
? 10830...

result:

ok ok, 19999 queries used

Subtask #5:

score: 10
Accepted

Test #54:

score: 10
Accepted
time: 10ms
memory: 3568kb

input:

12000
0
1
0
1
0
1
0
0
0
0
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 5061 1079 1625
? 1625 1079 5061
? 1625 1079 8006
? 8006 1079 1625
? 1625 8006 4543
? 4543 8006 1625
? 1625 4543 554
? 554 4543 1625
? 554 4543 474
? 554 4543 1539
? 554 4543 8927
? 554 4543 6112
? 554 4543 2826
? 554 4543 9154...

result:

ok ok, 12014 queries used

Test #55:

score: 0
Accepted
time: 24ms
memory: 3588kb

input:

12000
0
0
0
1
0
1
0
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 5061 10830 1625
? 1625 10830 5061
? 1625 10830 8006
? 8006 10830 1625
? 8006 10830 4543
? 8006 10830 554
? 8006 10830 474
? 8006 10830 1539
? 8006 10830 8927
? 8006 10830 6112
? 6112 10830 8006
? 6112 10830 2826
? 6112 10830 9...

result:

ok ok, 12011 queries used

Test #56:

score: 0
Accepted
time: 44ms
memory: 3860kb

input:

12000
0
0
0
1
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 5061 10830 1625
? 1625 10830 5061
? 5061 1625 8006
? 5061 1625 4543
? 5061 1625 554
? 5061 1625 474
? 5061 1625 1539
? 5061 1625 8927
? 5061 1625 6112
? 5061 1625 2826
? 5061 1625 9154
? 5061 1625 10108
? 5061 1625 1962
? 1962...

result:

ok ok, 12017 queries used

Test #57:

score: 0
Accepted
time: 6ms
memory: 3640kb

input:

12000
0
0
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 3901 10830 1625
? 3901 10830 8006
? 3901 10830 4543
? 3901 10830 554
? 3901 10830 474
? 3901 10830 1539
? 3901 10830 8927
? 3901 10830 6112
? 3901 10830 2826
? 3901 10830 9154
? 9154 10830 3901
? 3901 9154 10108
? 3901 9154 1962
? 3901 9154 181...

result:

ok ok, 12010 queries used

Test #58:

score: 0
Accepted
time: 16ms
memory: 3792kb

input:

12000
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 10830 1625 8006
? 10830 1625 4543
? 10830 1625 554
? 10830 1625 474
? 10830 1625 1539
? 10830 1625 8927
? 10830 1625 6112
? 10830 1625 2826
? 10830 1625 9154
? 10830 1625 10108
? 10830 1625 1962
? 10830 1625 ...

result:

ok ok, 12017 queries used

Test #59:

score: 0
Accepted
time: 5ms
memory: 3640kb

input:

12000
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 8006
? 10830 1079 4543
? 10830 1079 554
? 10830 1079 474
? 474 1079 10830
? 10830 474 1539
? 1539 474 10830
? 1539 474 8927
? 1539 474 6112
? 1539 474 2826
? 1539 474 9154
? 1539 474 10108
? 1539 474 1962
? 1539 474...

result:

ok ok, 12020 queries used

Test #60:

score: 0
Accepted
time: 8ms
memory: 3796kb

input:

12000
0
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
0
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 10830 1625 8006
? 10830 1625 4543
? 10830 1625 554
? 10830 1625 474
? 10830 1625 1539
? 10830 1625 8927
? 8927 1625 10830
? 10830 8927 6112
? 10830 8927 2826
? 10830 8927 9154
? 10830 8927 10108
? 10830 8927 ...

result:

ok ok, 12023 queries used

Test #61:

score: 0
Accepted
time: 14ms
memory: 3660kb

input:

12000
1
1
0
1
1
1
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 1625 1079 3901
? 1625 1079 8006
? 1625 1079 4543
? 1625 1079 554
? 554 1079 1625
? 554 1079 474
? 474 1079 554
? 554 474 1539
? 554 474 8927
? 554 474 6112
? 554 474 2826
? 554 474 9154
? 554 474 10108
? 554 474 1962
? 554 474 1819
? 554 474 3646...

result:

ok ok, 12015 queries used

Test #62:

score: 0
Accepted
time: 12ms
memory: 3796kb

input:

12000
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 8006
? 10830 1079 4543
? 10830 1079 554
? 554 1079 10830
? 10830 554 474
? 474 554 10830
? 10830 474 1539
? 10830 474 8927
? 10830 474 6112
? 10830 474 2826
? 10830 474 9154
? 10830 474 10108
? 10830 474 1962
? 1083...

result:

ok ok, 12019 queries used

Test #63:

score: 0
Accepted
time: 15ms
memory: 3580kb

input:

12000
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 8006
? 10830 1079 4543
? 10830 1079 554
? 554 1079 10830
? 10830 554 474
? 474 554 10830
? 10830 474 1539
? 10830 474 8927
? 10830 474 6112
? 10830 474 2826
? 10830 474 9154
? 10830 474 10108
? 10830 474 1962
? 1083...

result:

ok ok, 12018 queries used

Test #64:

score: 0
Accepted
time: 4ms
memory: 3864kb

input:

12000
0
1
1
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 10830 1625 8006
? 10830 1625 4543
? 10830 1625 554
? 10830 1625 474
? 10830 1625 1539
? 10830 1625 8927
? 10830 1625 6112
? 10830 1625 2826
? 10830 1625 9154
? 9154 1625 10830
? 10830 9154 10108
? 10830 9154 ...

result:

ok ok, 12023 queries used

Test #65:

score: 0
Accepted
time: 27ms
memory: 3524kb

input:

12000
1
1
1
1
1
0
0
0
0
1
1
1
0
1
1
1
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 8006
? 3901 1079 4543
? 3901 1079 554
? 554 1079 3901
? 3901 554 474
? 474 554 3901
? 3901 474 1539
? 3901 474 8927
? 3901 474 6112
? 3901 474 2826
? 2826 474 3901
? 2826 474 9154
? 2826 474 10108
? 2826 474 1962
? 1962 474 2826
? 1962 ...

result:

ok ok, 12021 queries used

Test #66:

score: 0
Accepted
time: 22ms
memory: 3596kb

input:

12000
0
0
0
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
0
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 5061 10830 1625
? 5061 10830 8006
? 8006 10830 5061
? 8006 10830 4543
? 8006 10830 554
? 8006 10830 474
? 8006 10830 1539
? 8006 10830 8927
? 8927 10830 8006
? 8927 10830 6112
? 8927 10830 2826
? 8927 10830 9154
? 8927 10830 1...

result:

ok ok, 12024 queries used

Test #67:

score: 0
Accepted
time: 9ms
memory: 3532kb

input:

12000
0
1
1
0
1
1
1
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 1625 1079 8006
? 1625 1079 4543
? 1625 1079 554
? 554 1079 1625
? 554 1079 474
? 474 1079 554
? 554 474 1539
? 554 474 8927
? 554 474 6112
? 554 474 2826
? 554 474 9154
? 554 474 10108
? 554 474 1962
? 554 47...

result:

ok ok, 12016 queries used

Subtask #6:

score: 4
Accepted

Test #68:

score: 4
Accepted
time: 24ms
memory: 3672kb

input:

20000
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 3901 10830 1625
? 3901 10830 19809
? 3901 10830 13493
? 3901 10830 554
? 3901 10830 474
? 474 10830 3901
? 3901 474 12197
? 3901 474 8927
? 3901 474 6112
? 3901 474 12916
? 3901 474 9154
? 3901 474 10108
? 3901 474 19554
? 3901 474 17949
? 3901...

result:

ok ok, 20013 queries used

Test #69:

score: 0
Accepted
time: 23ms
memory: 3892kb

input:

20000
0
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 5061 1079 1625
? 5061 1079 19809
? 5061 1079 13493
? 5061 1079 554
? 5061 1079 474
? 5061 1079 12197
? 5061 1079 8927
? 8927 1079 5061
? 8927 1079 6112
? 8927 1079 12916
? 8927 1079 9154
? 8927 1079 10108
? 8927 1079 19554
? 8...

result:

ok ok, 20010 queries used

Test #70:

score: 0
Accepted
time: 5ms
memory: 3652kb

input:

20000
1
1
0
0
0
1
0
1
1
1
1
1
0
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 1625 1079 3901
? 3901 1625 19809
? 19809 1625 3901
? 19809 1625 13493
? 13493 1625 19809
? 13493 1625 554
? 13493 1625 474
? 13493 1625 12197
? 13493 1625 8927
? 13493 1625 6112
? 6112 1625 13493
? 6112 1625 12916
? 6112 1625 9154
? 6112 1625 101...

result:

ok ok, 20022 queries used

Test #71:

score: 0
Accepted
time: 23ms
memory: 3808kb

input:

20000
1
0
0
1
1
1
1
1
0
1
1
1
1
1
0
0
1
1
0
1
1
1
1
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 5061 1079 3901
? 3901 5061 1625
? 3901 5061 19809
? 3901 5061 13493
? 3901 5061 554
? 3901 5061 474
? 3901 5061 12197
? 12197 5061 3901
? 12197 5061 8927
? 12197 5061 6112
? 12197 5061 12916
? 12197 5061 9154
? 12197 5061 10108
? 10108 5061 12197
? 12197 10108 19...

result:

ok ok, 20019 queries used

Test #72:

score: 0
Accepted
time: 35ms
memory: 3540kb

input:

20000
0
0
1
0
0
1
1
1
0
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 3901 10830 1625
? 1625 10830 3901
? 3901 1625 19809
? 3901 1625 13493
? 3901 1625 554
? 3901 1625 474
? 474 1625 3901
? 474 1625 12197
? 12197 1625 474
? 474 12197 8927
? 474 12197 6112
? 474 12197 12916
? 474 12197 9154
? 474 12197 10108
? 474...

result:

ok ok, 20019 queries used

Test #73:

score: 0
Accepted
time: 18ms
memory: 3888kb

input:

20000
0
1
0
1
1
1
0
1
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 5061 1079 1625
? 5061 1079 19809
? 5061 1079 13493
? 13493 1079 5061
? 13493 1079 554
? 13493 1079 474
? 474 1079 13493
? 474 1079 12197
? 474 1079 8927
? 474 1079 6112
? 474 1079 12916
? 12916 1079 474
? 474 12916 9154
? 474 ...

result:

ok ok, 20017 queries used

Test #74:

score: 0
Accepted
time: 23ms
memory: 3564kb

input:

20000
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 3901 1079 19809
? 3901 1079 13493
? 13493 1079 3901
? 3901 13493 554
? 3901 13493 474
? 3901 13493 12197
? 3901 13493 8927
? 3901 13493 6112
? 3901 13493 12916
? 3901 13493 9154
? 3901 13493 10108
? 3901 13493 19554
? 3901 13493 17949
? 3901 1349...

result:

ok ok, 20012 queries used

Test #75:

score: 0
Accepted
time: 19ms
memory: 3692kb

input:

20000
0
1
1
0
0
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 10830 1625 19809
? 10830 1625 13493
? 13493 1625 10830
? 10830 13493 554
? 10830 13493 474
? 10830 13493 12197
? 10830 13493 8927
? 10830 13493 6112
? 10830 13493 12916
? 10830 13493 9154
? 10830 13493 10108
...

result:

ok ok, 20020 queries used

Test #76:

score: 0
Accepted
time: 36ms
memory: 3892kb

input:

20000
1
1
0
0
0
0
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 1625 1079 3901
? 3901 1625 19809
? 19809 1625 3901
? 3901 19809 13493
? 3901 19809 554
? 3901 19809 474
? 3901 19809 12197
? 3901 19809 8927
? 8927 19809 3901
? 8927 19809 6112
? 8927 19809 12916
? 8927 19809 9154
? 8927 19809 10108
? 8927 19809 ...

result:

ok ok, 20013 queries used

Test #77:

score: 0
Accepted
time: 24ms
memory: 3676kb

input:

20000
0
0
0
0
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 3901 5061 1625
? 3901 5061 19809
? 3901 5061 13493
? 3901 5061 554
? 554 5061 3901
? 3901 554 474
? 3901 554 12197
? 3901 554 8927
? 3901 554 6112
? 3901 554 12916
? 3901 554 9154
? 3901 554 10108
? 3901 554 19554
? 3901 554 1...

result:

ok ok, 20016 queries used

Test #78:

score: 0
Accepted
time: 21ms
memory: 3676kb

input:

20000
0
0
0
1
1
1
1
0
0
0
1
1
1
1
1
1
1
0
0
1
0
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 5061 10830 1625
? 5061 10830 19809
? 5061 10830 13493
? 5061 10830 554
? 554 10830 5061
? 5061 554 474
? 474 554 5061
? 474 554 12197
? 474 554 8927
? 474 554 6112
? 474 554 12916
? 474 554 9154
? 474 554 10108
? 474 554 19554...

result:

ok ok, 20015 queries used

Test #79:

score: 0
Accepted
time: 31ms
memory: 3688kb

input:

20000
0
1
0
1
0
0
1
0
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 5061 1079 1625
? 1625 1079 5061
? 5061 1625 19809
? 5061 1625 13493
? 13493 1625 5061
? 5061 13493 554
? 554 13493 5061
? 5061 554 474
? 474 554 5061
? 474 554 12197
? 474 554 8927
? 474 554 6112
? 474 554 12916
? 474 554 9154...

result:

ok ok, 20015 queries used

Test #80:

score: 0
Accepted
time: 19ms
memory: 3668kb

input:

20000
0
1
0
0
1
0
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 10830 5061 1625
? 10830 5061 19809
? 19809 5061 10830
? 19809 5061 13493
? 19809 5061 554
? 19809 5061 474
? 19809 5061 12197
? 12197 5061 19809
? 19809 12197 8927
? 19809 12197 6112
? 19809 12197 12916
? 19809 12197 9154
? 19...

result:

ok ok, 20014 queries used

Test #81:

score: 0
Accepted
time: 12ms
memory: 3544kb

input:

20000
0
1
1
1
1
1
0
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 10830 1079 13493
? 10830 1079 554
? 554 1079 10830
? 554 1079 474
? 474 1079 554
? 554 474 12197
? 554 474 8927
? 554 474 6112
? 554 474 12916
? 554 474 9154
? 554 474 10108
? 554 474 19554
? 554 474 17949
?...

result:

ok ok, 20015 queries used

Test #82:

score: 0
Accepted
time: 16ms
memory: 3624kb

input:

20000
0
1
1
1
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 19809 1079 13493
? 19809 1079 554
? 554 1079 19809
? 19809 554 474
? 474 554 19809
? 19809 474 12197
? 19809 474 8927
? 19809 474 6112
? 19809 474 12916
? 19809 474 9154
? 19809 474 10108
...

result:

ok ok, 20010 queries used

Test #83:

score: 0
Accepted
time: 15ms
memory: 3828kb

input:

20000
0
1
1
1
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 19809 1079 13493
? 19809 1079 554
? 554 1079 19809
? 19809 554 474
? 474 554 19809
? 19809 474 12197
? 19809 474 8927
? 19809 474 6112
? 19809 474 12916
? 19809 474 9154
? 19809 474 10108
...

result:

ok ok, 20010 queries used

Test #84:

score: 0
Accepted
time: 28ms
memory: 3676kb

input:

20000
0
1
0
0
1
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 10830 5061 1625
? 10830 5061 19809
? 19809 5061 10830
? 19809 5061 13493
? 19809 5061 554
? 19809 5061 474
? 19809 5061 12197
? 12197 5061 19809
? 19809 12197 8927
? 19809 12197 6112
? 19809 12197 12916
? 19809 12197 9154
? 19...

result:

ok ok, 20013 queries used

Test #85:

score: 0
Accepted
time: 21ms
memory: 3824kb

input:

20000
0
1
1
0
1
1
1
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 1625 1079 19809
? 1625 1079 13493
? 1625 1079 554
? 554 1079 1625
? 1625 554 474
? 474 554 1625
? 474 554 12197
? 474 554 8927
? 474 554 6112
? 474 554 12916
? 474 554 9154
? 474 554 10108
? 474 554 19554
? 4...

result:

ok ok, 20013 queries used

Test #86:

score: 0
Accepted
time: 13ms
memory: 3608kb

input:

20000
0
0
0
1
1
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 5061 10830 3901
? 5061 10830 1625
? 5061 10830 19809
? 19809 10830 5061
? 19809 10830 13493
? 19809 10830 554
? 19809 10830 474
? 19809 10830 12197
? 19809 10830 8927
? 19809 10830 6112
? 19809 10830 12916
? 12916 10830 19809
? 19809 12916 9154...

result:

ok ok, 20018 queries used

Test #87:

score: 0
Accepted
time: 26ms
memory: 3604kb

input:

20000
0
1
0
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 5061 1079 1625
? 5061 1079 19809
? 5061 1079 13493
? 5061 1079 554
? 554 1079 5061
? 5061 554 474
? 474 554 5061
? 5061 474 12197
? 5061 474 8927
? 5061 474 6112
? 5061 474 12916
? 5061 474 9154
? 5061 474 10108
? 5061 474 195...

result:

ok ok, 20019 queries used

Test #88:

score: 0
Accepted
time: 36ms
memory: 3668kb

input:

20000
0
1
1
0
0
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 1625 1079 10830
? 10830 1625 19809
? 19809 1625 10830
? 10830 19809 13493
? 10830 19809 554
? 10830 19809 474
? 10830 19809 12197
? 10830 19809 8927
? 10830 19809 6112
? 10830 19809 12916
? 12916 19809 10830
? 12916 19809 9154...

result:

ok ok, 20014 queries used

Test #89:

score: 0
Accepted
time: 24ms
memory: 3676kb

input:

20000
1
1
0
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 3901 1079 5061
? 3901 1079 1625
? 1625 1079 3901
? 1625 1079 19809
? 1625 1079 13493
? 1625 1079 554
? 554 1079 1625
? 1625 554 474
? 474 554 1625
? 1625 474 12197
? 1625 474 8927
? 1625 474 6112
? 1625 474 12916
? 1625 474 9154
? 1625 474 10108
? 1625 474 19554
? 1625 474 17949
...

result:

ok ok, 20010 queries used

Test #90:

score: 0
Accepted
time: 48ms
memory: 3672kb

input:

20000
0
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 5061 1079 10830
? 10830 5061 1625
? 10830 5061 19809
? 19809 5061 10830
? 19809 5061 13493
? 19809 5061 554
? 19809 5061 474
? 19809 5061 12197
? 19809 5061 8927
? 19809 5061 6112
? 19809 5061 12916
? 19809 5061 9154
? 19809 5061 10108
? 19809 ...

result:

ok ok, 20013 queries used

Test #91:

score: 0
Accepted
time: 20ms
memory: 3828kb

input:

20000
0
1
1
1
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 19809 1079 13493
? 19809 1079 554
? 554 1079 19809
? 19809 554 474
? 474 554 19809
? 19809 474 12197
? 19809 474 8927
? 19809 474 6112
? 19809 474 12916
? 19809 474 9154
? 19809 474 10108
...

result:

ok ok, 20017 queries used

Test #92:

score: 0
Accepted
time: 20ms
memory: 3596kb

input:

20000
0
0
1
1
0
1
0
0
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 3901 10830 5061
? 3901 10830 1625
? 3901 10830 19809
? 19809 10830 3901
? 19809 10830 13493
? 13493 10830 19809
? 19809 13493 554
? 19809 13493 474
? 19809 13493 12197
? 19809 13493 8927
? 19809 13493 6112
? 19809 13493 12916
? 19809 13493 9154
? 19809 13493 101...

result:

ok ok, 20010 queries used

Test #93:

score: 0
Accepted
time: 18ms
memory: 3664kb

input:

20000
0
1
1
1
0
1
1
0
0
0
0
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 19809 1079 13493
? 19809 1079 554
? 554 1079 19809
? 19809 554 474
? 474 554 19809
? 19809 474 12197
? 19809 474 8927
? 19809 474 6112
? 6112 474 19809
? 6112 474 12916
? 6112 474 9154
? 6...

result:

ok ok, 20020 queries used

Test #94:

score: 0
Accepted
time: 21ms
memory: 3560kb

input:

20000
0
1
1
1
0
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 10830 19809 13493
? 13493 19809 10830
? 13493 19809 554
? 13493 19809 474
? 13493 19809 12197
? 13493 19809 8927
? 13493 19809 6112
? 13493 19809 12916
? 13493 19809 9154
? 13493 19809 101...

result:

ok ok, 20012 queries used

Test #95:

score: 0
Accepted
time: 26ms
memory: 3696kb

input:

20000
0
1
1
1
0
1
1
0
0
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 3901 1079 10830
? 10830 1079 3901
? 10830 1079 5061
? 10830 1079 1625
? 10830 1079 19809
? 19809 1079 10830
? 19809 1079 13493
? 19809 1079 554
? 554 1079 19809
? 19809 554 474
? 474 554 19809
? 19809 474 12197
? 19809 474 8927
? 19809 474 6112
? 19809 474 12916
? 19809 474 9154
? 19809 474 10108
...

result:

ok ok, 20017 queries used

Extra Test:

score: 0
Extra Test Passed