QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#449551#8595. Точки на прямiйarbuzick#100 ✓44ms3916kbC++20865b2024-06-21 14:13:472024-06-21 14:13:47

Judging History

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

  • [2024-06-21 14:13:47]
  • 评测
  • 测评结果:100
  • 用时:44ms
  • 内存:3916kb
  • [2024-06-21 14:13:47]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

void solve() {
    int n;
    cin >> n;
    vector<int> ord(n);
    iota(ord.begin(), ord.end(), 1);
    mt19937 rnd(57);
    shuffle(ord.begin(), ord.end(), rnd);
    int a = ord[0], b = ord[1];
    for (int i = 2; i < n; ++i) {
        cout << "? " << a << ' ' << b << ' ' << ord[i] << endl;
        int ans;
        cin >> ans;
        if (ans) {
            continue;
        }
        cout << "? " << a << ' ' << ord[i] << ' ' << b << endl;
        cin >> ans;
        if (ans) {
            b = ord[i];
        } else {
            a = ord[i];
        }
    }
    cout << "! " << a << ' ' << b << endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
    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: 3528kb

input:

3
0
0

output:

? 3 1 2
? 3 2 1
! 2 1

result:

ok ok, 2 queries used

Test #2:

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

input:

3
0
1

output:

? 3 1 2
? 3 2 1
! 3 2

result:

ok ok, 2 queries used

Test #3:

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

input:

4
1
1

output:

? 2 3 1
? 2 3 4
! 2 3

result:

ok ok, 2 queries used

Test #4:

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

input:

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

output:

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

result:

ok ok, 22 queries used

Test #5:

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

input:

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

output:

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

result:

ok ok, 23 queries used

Test #6:

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

input:

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

output:

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

result:

ok ok, 23 queries used

Test #7:

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

input:

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

output:

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

result:

ok ok, 20 queries used

Test #8:

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

input:

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

output:

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

result:

ok ok, 21 queries used

Test #9:

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

input:

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

output:

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

result:

ok ok, 20 queries used

Test #10:

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

input:

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

output:

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

result:

ok ok, 23 queries used

Test #11:

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

input:

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

output:

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

result:

ok ok, 22 queries used

Test #12:

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

input:

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

output:

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

result:

ok ok, 23 queries used

Test #13:

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

input:

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

output:

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

result:

ok ok, 20 queries used

Subtask #2:

score: 16
Accepted

Test #14:

score: 16
Accepted
time: 1ms
memory: 3840kb

input:

100
0
1
0
1
0
0
1
1
1
1
0
1
1
1
1
0
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
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
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 14 28 85
? 14 85 28
? 85 28 2
? 85 28 69
? 85 28 34
? 85 28 16
? 85 28 93
? 85 93 28
? 85 93 68
? 85 93 58
? 85 93 84
? 85 93 55
? 85 55 93
? 85 55 11
? 85 55 88
? 85 88 55
? 88 55 51
? 88 55 33
? 88 55 62
? 88 55 46
? 88 55 49
? 88 55 23
? 88 55 35
? 88...

result:

ok ok, 108 queries used

Test #15:

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

input:

100
0
0
1
1
0
1
1
1
0
0
1
1
1
1
0
1
1
1
0
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
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
0
0
1
1
1
1
1
1
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 41 59 28
? 41 59 85
? 41 59 2
? 41 2 59
? 41 2 69
? 41 2 34
? 41 2 16
? 41 16 2
? 16 2 93
? 16 2 68
? 16 2 58
? 16 2 84
? 16 2 55
? 16 55 2
? 16 55 11
? 16 55 88
? 16 55 51
? 16 51 55
? 16 51 33
? 16 33 51
? 33 51 62
? 33 51 46
? 33 51 49
? 33 51 23
? 33 23 51
? 23 51 35
? 23...

result:

ok ok, 108 queries used

Test #16:

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

input:

100
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
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

output:

? 14 59 41
? 14 59 28
? 14 59 85
? 14 59 2
? 14 59 69
? 14 69 59
? 14 69 34
? 14 34 69
? 14 34 16
? 14 34 93
? 14 34 68
? 14 34 58
? 14 34 84
? 14 34 55
? 14 34 11
? 14 34 88
? 14 34 51
? 14 34 33
? 14 33 34
? 33 34 62
? 33 34 46
? 33 34 49
? 33 34 23
? 33 34 35
? 33 34 6
? 33 34 44
? 33 34 13
? 33 ...

result:

ok ok, 102 queries used

Test #17:

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

input:

100
0
1
0
0
0
0
1
0
0
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
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

output:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 28 41 85
? 28 85 41
? 85 41 2
? 85 41 69
? 85 69 41
? 69 41 34
? 69 34 41
? 69 34 16
? 69 34 93
? 69 93 34
? 69 93 68
? 69 93 58
? 69 93 84
? 69 93 55
? 69 93 11
? 69 93 88
? 69 93 51
? 69 93 33
? 69 93 62
? 69 93 46
? 69 93 49
? 69 93 23
? 69 93 35
? 69...

result:

ok ok, 105 queries used

Test #18:

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

input:

100
0
1
0
0
0
0
1
1
0
1
0
0
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
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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 28 41 85
? 28 85 41
? 85 41 2
? 85 41 69
? 85 41 34
? 85 34 41
? 85 34 16
? 85 16 34
? 16 34 93
? 16 34 68
? 16 34 58
? 16 34 84
? 16 84 34
? 16 84 55
? 16 84 11
? 16 84 88
? 16 88 84
? 88 84 51
? 88 84 33
? 88 84 62
? 88 84 46
? 88 84 49
? 88 84 23
? 88...

result:

ok ok, 109 queries used

Test #19:

score: 16
Accepted
time: 1ms
memory: 3788kb

input:

100
0
1
0
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
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 14 28 85
? 14 28 2
? 14 28 69
? 14 28 34
? 14 28 16
? 14 28 93
? 14 28 68
? 14 28 58
? 14 28 84
? 14 28 55
? 14 28 11
? 14 28 88
? 14 88 28
? 14 88 51
? 14 88 33
? 14 88 62
? 14 88 46
? 14 88 49
? 14 88 23
? 14 88 35
? 14 35 88
? 14 35 6
? 14 35 44
? 14 ...

result:

ok ok, 105 queries used

Test #20:

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

input:

100
0
0
1
0
1
1
0
0
1
1
0
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
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
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 41 59 28
? 41 59 85
? 41 85 59
? 41 85 2
? 41 85 69
? 41 69 85
? 69 85 34
? 69 85 16
? 69 85 93
? 69 93 85
? 69 93 68
? 69 93 58
? 69 93 84
? 69 84 93
? 84 93 55
? 84 93 11
? 84 93 88
? 84 93 51
? 84 93 33
? 84 93 62
? 84 93 46
? 84 93 49
? 84 93 23
? 84 93 35
? 84 93 6
? 84 ...

result:

ok ok, 107 queries used

Test #21:

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

input:

100
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
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

output:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 14 28 85
? 14 28 2
? 14 2 28
? 2 28 69
? 2 28 34
? 2 28 16
? 2 28 93
? 2 28 68
? 2 28 58
? 2 28 84
? 2 28 55
? 2 28 11
? 2 28 88
? 2 28 51
? 2 28 33
? 2 28 62
? 2 28 46
? 2 28 49
? 2 28 23
? 2 23 28
? 2 23 35
? 2 23 6
? 2 23 44
? 2 23 13
? 2 23 29
? 2 23...

result:

ok ok, 104 queries used

Test #22:

score: 16
Accepted
time: 1ms
memory: 3536kb

input:

100
1
1
0
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
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
0
1
1
1
1
1

output:

? 14 59 41
? 14 59 28
? 14 59 85
? 14 85 59
? 14 85 2
? 14 2 85
? 2 85 69
? 2 85 34
? 2 85 16
? 2 85 93
? 2 93 85
? 2 93 68
? 2 93 58
? 2 93 84
? 2 93 55
? 2 93 11
? 2 93 88
? 2 93 51
? 2 93 33
? 2 93 62
? 2 93 46
? 2 93 49
? 2 93 23
? 2 93 35
? 2 93 6
? 2 93 44
? 2 93 13
? 2 93 29
? 2 93 66
? 2 93 ...

result:

ok ok, 104 queries used

Test #23:

score: 16
Accepted
time: 1ms
memory: 3536kb

input:

100
1
1
0
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
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
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
1
1
1
1
1

output:

? 14 59 41
? 14 59 28
? 14 59 85
? 14 85 59
? 14 85 2
? 14 2 85
? 2 85 69
? 2 85 34
? 2 85 16
? 2 85 93
? 2 93 85
? 2 93 68
? 2 93 58
? 2 93 84
? 2 93 55
? 2 93 11
? 2 93 88
? 2 93 51
? 2 93 33
? 2 93 62
? 2 93 46
? 2 93 49
? 2 93 23
? 2 93 35
? 2 93 6
? 2 93 44
? 2 93 13
? 2 93 29
? 2 93 66
? 2 93 ...

result:

ok ok, 105 queries used

Test #24:

score: 16
Accepted
time: 1ms
memory: 3536kb

input:

100
1
1
0
1
0
0
1
1
1
0
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
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
0
1
1
1
1
1

output:

? 14 59 41
? 14 59 28
? 14 59 85
? 14 85 59
? 14 85 2
? 14 2 85
? 2 85 69
? 2 85 34
? 2 85 16
? 2 85 93
? 2 93 85
? 2 93 68
? 2 93 58
? 2 93 84
? 2 84 93
? 84 93 55
? 84 93 11
? 84 93 88
? 84 93 51
? 84 93 33
? 84 93 62
? 84 93 46
? 84 93 49
? 84 93 23
? 84 93 35
? 84 93 6
? 84 93 44
? 84 93 13
? 84...

result:

ok ok, 106 queries used

Test #25:

score: 16
Accepted
time: 1ms
memory: 3844kb

input:

100
1
1
0
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
0
0
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
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:

? 14 59 41
? 14 59 28
? 14 59 85
? 14 85 59
? 14 85 2
? 14 2 85
? 14 2 69
? 14 2 34
? 14 2 16
? 14 2 93
? 14 2 68
? 14 2 58
? 14 2 84
? 14 2 55
? 14 2 11
? 14 11 2
? 11 2 88
? 11 2 51
? 11 2 33
? 11 2 62
? 11 2 46
? 11 2 49
? 11 2 23
? 11 2 35
? 11 2 6
? 11 2 44
? 11 2 13
? 11 2 29
? 11 2 66
? 11 2 ...

result:

ok ok, 104 queries used

Test #26:

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

input:

100
0
0
1
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
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
0
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

output:

? 14 59 41
? 14 41 59
? 41 59 28
? 41 59 85
? 41 85 59
? 41 85 2
? 41 85 69
? 41 85 34
? 41 85 16
? 41 85 93
? 41 93 85
? 93 85 68
? 93 85 58
? 93 85 84
? 93 85 55
? 93 85 11
? 93 85 88
? 93 85 51
? 93 85 33
? 93 85 62
? 93 85 46
? 93 85 49
? 93 85 23
? 93 85 35
? 93 85 6
? 93 85 44
? 93 85 13
? 93 ...

result:

ok ok, 105 queries used

Test #27:

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

input:

100
0
1
0
1
1
0
0
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
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:

? 14 59 41
? 14 41 59
? 14 41 28
? 14 28 41
? 14 28 85
? 14 28 2
? 14 2 28
? 2 28 69
? 2 28 34
? 2 28 16
? 2 16 28
? 2 16 93
? 2 16 68
? 2 16 58
? 2 16 84
? 2 16 55
? 2 16 11
? 2 11 16
? 2 11 88
? 2 11 51
? 2 11 33
? 2 11 62
? 2 11 46
? 2 11 49
? 2 11 23
? 2 11 35
? 2 11 6
? 2 11 44
? 2 11 13
? 2 11...

result:

ok ok, 104 queries used

Subtask #3:

score: 30
Accepted

Test #28:

score: 30
Accepted
time: 11ms
memory: 3648kb

input:

10000
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
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
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
...

output:

? 7940 7543 3602
? 7940 7543 8519
? 7940 8519 7543
? 7940 8519 5727
? 7940 8519 7889
? 7940 7889 8519
? 7889 8519 5177
? 7889 8519 101
? 7889 8519 8439
? 7889 8519 6278
? 7889 8519 2883
? 7889 8519 7095
? 7889 8519 5374
? 7889 8519 2681
? 7889 2681 8519
? 7889 2681 2570
? 7889 2681 6886
? 7889 2681 ...

result:

ok ok, 10014 queries used

Test #29:

score: 30
Accepted
time: 12ms
memory: 3620kb

input:

10000
1
0
1
1
0
0
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
0
0
1
1
1
1
1
1
1
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
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
...

output:

? 7940 7543 3602
? 7940 7543 8519
? 7940 8519 7543
? 7940 8519 5727
? 7940 8519 7889
? 7940 7889 8519
? 7889 8519 5177
? 7889 8519 101
? 7889 8519 8439
? 7889 8439 8519
? 8439 8519 6278
? 8439 8519 2883
? 8439 8519 7095
? 8439 8519 5374
? 8439 8519 2681
? 8439 2681 8519
? 2681 8519 2570
? 2681 8519 ...

result:

ok ok, 10012 queries used

Test #30:

score: 30
Accepted
time: 16ms
memory: 3652kb

input:

10000
0
1
0
0
0
1
1
1
1
1
1
0
0
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
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
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
1
1
1
1
1
1
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 5727 3602
? 8519 5727 7889
? 8519 5727 5177
? 8519 5727 101
? 8519 5727 8439
? 8519 5727 6278
? 8519 5727 2883
? 8519 2883 5727
? 2883 5727 7095
? 2883 5727 5374
? 2883 5374 5727
? 2883 5374 2681
? 2883 5374 ...

result:

ok ok, 10013 queries used

Test #31:

score: 30
Accepted
time: 9ms
memory: 3824kb

input:

10000
0
1
1
1
1
1
0
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
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 3602 5727
? 7940 3602 7889
? 7940 3602 5177
? 7940 3602 101
? 7940 101 3602
? 7940 101 8439
? 7940 101 6278
? 7940 101 2883
? 7940 2883 101
? 7940 2883 7095
? 7940 2883 5374
? 7940 2883 2681
? 7940 2883 2570
? 7940 2570 2883
? 7940 2570 6886
...

result:

ok ok, 10011 queries used

Test #32:

score: 30
Accepted
time: 4ms
memory: 3560kb

input:

10000
0
1
1
0
1
1
0
1
1
1
1
1
1
1
1
1
1
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 3602 5727
? 7940 5727 3602
? 7940 5727 7889
? 7940 5727 5177
? 7940 5177 5727
? 7940 5177 101
? 7940 5177 8439
? 7940 5177 6278
? 7940 5177 2883
? 7940 5177 7095
? 7940 5177 5374
? 7940 5177 2681
? 7940 5177 2570
? 7940 5177 6886
? 7940 5177 ...

result:

ok ok, 10021 queries used

Test #33:

score: 30
Accepted
time: 26ms
memory: 3828kb

input:

10000
0
1
0
1
1
0
1
1
1
1
0
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
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
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
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 7940 8519 5727
? 7940 8519 7889
? 7940 7889 8519
? 7940 7889 5177
? 7940 7889 101
? 7940 7889 8439
? 7940 7889 6278
? 7940 6278 7889
? 7940 6278 2883
? 7940 2883 6278
? 2883 6278 7095
? 2883 6278 5374
? 2883 6278 2681
? 2883 6278 ...

result:

ok ok, 10020 queries used

Test #34:

score: 30
Accepted
time: 11ms
memory: 3576kb

input:

10000
1
0
1
1
1
1
1
0
0
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
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
0
0
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
1
1
1
1
1
1
1
1
1
...

output:

? 7940 7543 3602
? 7940 7543 8519
? 7940 8519 7543
? 7940 8519 5727
? 7940 8519 7889
? 7940 8519 5177
? 7940 8519 101
? 7940 8519 8439
? 7940 8439 8519
? 8439 8519 6278
? 8439 8519 2883
? 8439 8519 7095
? 8439 8519 5374
? 8439 8519 2681
? 8439 8519 2570
? 8439 8519 6886
? 8439 8519 3074
? 8439 8519 ...

result:

ok ok, 10013 queries used

Test #35:

score: 30
Accepted
time: 16ms
memory: 3560kb

input:

10000
0
1
0
0
1
0
0
1
0
1
1
0
0
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
0
0
0
1
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 3602 7889
? 8519 7889 3602
? 7889 3602 5177
? 7889 3602 101
? 7889 101 3602
? 7889 101 8439
? 7889 101 6278
? 7889 6278 101
? 6278 101 2883
? 6278 2883 101
? 2883 101 7095
? 2883 101 5374
? 2883 101 2681
? 28...

result:

ok ok, 10018 queries used

Test #36:

score: 30
Accepted
time: 16ms
memory: 3640kb

input:

10000
0
1
0
0
1
1
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
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
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 3602 7889
? 8519 3602 5177
? 8519 3602 101
? 8519 101 3602
? 8519 101 8439
? 8519 101 6278
? 8519 101 2883
? 8519 101 7095
? 8519 101 5374
? 8519 101 2681
? 8519 101 2570
? 8519 101 6886
? 8519 101 3074
? 851...

result:

ok ok, 10007 queries used

Test #37:

score: 30
Accepted
time: 25ms
memory: 3652kb

input:

10000
0
1
0
0
1
1
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
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
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 3602 7889
? 8519 3602 5177
? 8519 3602 101
? 8519 101 3602
? 8519 101 8439
? 8519 101 6278
? 8519 101 2883
? 8519 101 7095
? 8519 101 5374
? 8519 101 2681
? 8519 101 2570
? 8519 101 6886
? 8519 101 3074
? 851...

result:

ok ok, 10008 queries used

Test #38:

score: 30
Accepted
time: 8ms
memory: 3636kb

input:

10000
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
1
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
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 7940 7543 3602
? 7940 7543 8519
? 7940 8519 7543
? 7940 8519 5727
? 7940 8519 7889
? 7940 8519 5177
? 7940 8519 101
? 7940 8519 8439
? 7940 8519 6278
? 7940 8519 2883
? 7940 8519 7095
? 7940 8519 5374
? 7940 8519 2681
? 7940 8519 2570
? 7940 8519 6886
? 7940 8519 3074
? 7940 8519 1960
? 7940 8519 ...

result:

ok ok, 10006 queries used

Test #39:

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

input:

10000
0
1
0
0
0
0
1
0
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
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 5727 3602
? 5727 3602 7889
? 5727 3602 5177
? 5727 5177 3602
? 5177 3602 101
? 5177 101 3602
? 5177 101 8439
? 5177 101 6278
? 5177 101 2883
? 5177 101 7095
? 5177 101 5374
? 5177 101 2681
? 5177 101 2570
? 5...

result:

ok ok, 10012 queries used

Test #40:

score: 30
Accepted
time: 16ms
memory: 3560kb

input:

10000
1
0
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
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
1
1
1
1
1
1
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 7940 7543 3602
? 7940 7543 8519
? 7940 8519 7543
? 7940 8519 5727
? 7940 8519 7889
? 7940 8519 5177
? 7940 8519 101
? 7940 8519 8439
? 7940 8519 6278
? 7940 8519 2883
? 7940 8519 7095
? 7940 8519 5374
? 7940 8519 2681
? 7940 8519 2570
? 7940 8519 6886
? 7940 8519 3074
? 7940 8519 1960
? 7940 8519 ...

result:

ok ok, 10009 queries used

Test #41:

score: 30
Accepted
time: 4ms
memory: 3684kb

input:

10000
0
1
0
0
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 7940 7543 3602
? 7940 3602 7543
? 7940 3602 8519
? 7940 8519 3602
? 8519 3602 5727
? 8519 3602 7889
? 8519 3602 5177
? 8519 3602 101
? 8519 101 3602
? 8519 101 8439
? 8519 101 6278
? 8519 101 2883
? 8519 101 7095
? 8519 101 5374
? 8519 101 2681
? 8519 101 2570
? 8519 101 6886
? 8519 6886 101
? 688...

result:

ok ok, 10014 queries used

Subtask #4:

score: 23
Accepted

Test #42:

score: 23
Accepted
time: 33ms
memory: 3840kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19998 queries used

Test #43:

score: 23
Accepted
time: 26ms
memory: 3724kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #44:

score: 23
Accepted
time: 28ms
memory: 3680kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #45:

score: 23
Accepted
time: 20ms
memory: 3628kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #46:

score: 23
Accepted
time: 32ms
memory: 3840kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #47:

score: 23
Accepted
time: 29ms
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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #48:

score: 23
Accepted
time: 24ms
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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #49:

score: 23
Accepted
time: 29ms
memory: 3668kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19999 queries used

Test #50:

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

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19998 queries used

Test #51:

score: 23
Accepted
time: 22ms
memory: 3840kb

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:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 19884 19180
? 11637 19884 19378
? 11637 19884 101
? 11637 19884 8439
? 11637 19884 6278
? 11637 19884 17228
? 11637 19884 13298
? 11637 19884 11627
? 11637 19884 17653
? 11637 19884 14407
? 11637 19884 13143
? 11637 ...

result:

ok ok, 19999 queries used

Test #52:

score: 23
Accepted
time: 21ms
memory: 3916kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19998 queries used

Test #53:

score: 23
Accepted
time: 26ms
memory: 3844kb

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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 7543 19180
? 11637 7543 19378
? 11637 7543 101
? 11637 7543 8439
? 11637 7543 6278
? 11637 7543 17228
? 11637 7543 13298
? 11637 7543 11627
? 11637 7543 17653
? 11637 7543 14407
? 11637 7543 13143
? 11637 7543 3074
? 11637 7543 14171
? 1...

result:

ok ok, 19998 queries used

Subtask #5:

score: 10
Accepted

Test #54:

score: 10
Accepted
time: 23ms
memory: 3828kb

input:

12000
1
0
0
0
1
0
0
0
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
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
0
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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 11637 7543 3602
? 11637 7543 8519
? 11637 8519 7543
? 8519 7543 5727
? 8519 5727 7543
? 8519 5727 7889
? 8519 7889 5727
? 7889 5727 5177
? 7889 5177 5727
? 5177 5727 101
? 5177 101 5727
? 5177 101 8439
? 5177 101 6278
? 5177 101 2883
? 5177 2883 101
? 5177 2883 7095
? 5177 2883 11627
? 5177 2883 2...

result:

ok ok, 12017 queries used

Test #55:

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

input:

12000
0
0
1
0
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 3602 7543 8519
? 3602 7543 5727
? 3602 5727 7543
? 5727 7543 7889
? 5727 7889 7543
? 7889 7543 5177
? 7889 5177 7543
? 7889 5177 101
? 7889 5177 8439
? 7889 5177 6278
? 7889 5177 2883
? 7889 5177 7095
? 7889 5177 11627
? 7889 5177 2681
? 7889 5177 2570
? 7889 51...

result:

ok ok, 12012 queries used

Test #56:

score: 10
Accepted
time: 17ms
memory: 3628kb

input:

12000
0
0
0
0
1
0
0
0
0
0
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
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
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
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:

? 11637 7543 3602
? 11637 3602 7543
? 3602 7543 8519
? 3602 8519 7543
? 8519 7543 5727
? 8519 7543 7889
? 8519 7889 7543
? 7889 7543 5177
? 7889 5177 7543
? 5177 7543 101
? 5177 101 7543
? 5177 101 8439
? 5177 101 6278
? 5177 101 2883
? 5177 101 7095
? 5177 101 11627
? 5177 11627 101
? 11627 101 268...

result:

ok ok, 12017 queries used

Test #57:

score: 10
Accepted
time: 4ms
memory: 3828kb

input:

12000
0
1
0
0
1
1
0
1
0
0
1
0
0
0
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
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 8519 3602
? 8519 3602 5727
? 8519 3602 7889
? 8519 3602 5177
? 8519 5177 3602
? 8519 5177 101
? 8519 101 5177
? 101 5177 8439
? 101 5177 6278
? 101 6278 5177
? 6278 5177 2883
? 6278 2883 5177
? 6278 2883 7095
? 6278 2883 11627
? 6278 2883...

result:

ok ok, 12014 queries used

Test #58:

score: 10
Accepted
time: 9ms
memory: 3656kb

input:

12000
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
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
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
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
...

output:

? 11637 7543 3602
? 11637 7543 8519
? 11637 8519 7543
? 8519 7543 5727
? 8519 7543 7889
? 8519 7543 5177
? 8519 7543 101
? 8519 7543 8439
? 8519 7543 6278
? 8519 7543 2883
? 8519 7543 7095
? 8519 7543 11627
? 8519 7543 2681
? 8519 7543 2570
? 8519 7543 6886
? 8519 7543 3074
? 8519 7543 11109
? 8519 ...

result:

ok ok, 12011 queries used

Test #59:

score: 10
Accepted
time: 16ms
memory: 3660kb

input:

12000
0
1
0
1
1
1
1
0
0
1
1
0
1
1
1
1
1
0
0
1
0
0
1
1
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
0
0
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 8519 3602
? 11637 8519 5727
? 11637 8519 7889
? 11637 8519 5177
? 11637 8519 101
? 11637 101 8519
? 101 8519 8439
? 101 8519 6278
? 101 8519 2883
? 101 2883 8519
? 101 2883 7095
? 101 2883 11627
? 101 2883 2681
? 101 2883 2570
? 101 2883 ...

result:

ok ok, 12016 queries used

Test #60:

score: 10
Accepted
time: 25ms
memory: 3580kb

input:

12000
0
1
1
0
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
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
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 3602 5727
? 11637 5727 3602
? 11637 5727 7889
? 11637 7889 5727
? 11637 7889 5177
? 11637 7889 101
? 11637 7889 8439
? 11637 7889 6278
? 11637 7889 2883
? 11637 7889 7095
? 11637 7889 11627
? 11637 7889 2681
? 11637 7889 2570
? 11637 7889...

result:

ok ok, 12010 queries used

Test #61:

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

input:

12000
0
0
1
0
1
1
0
1
0
1
1
1
0
0
1
1
1
0
0
1
1
1
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
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
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
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 3602 7543 8519
? 3602 7543 5727
? 3602 5727 7543
? 3602 5727 7889
? 3602 5727 5177
? 3602 5177 5727
? 3602 5177 101
? 3602 101 5177
? 3602 101 8439
? 3602 101 6278
? 3602 101 2883
? 3602 2883 101
? 2883 101 7095
? 2883 101 11627
? 2883 101 2681
? 2883 101 2570
?...

result:

ok ok, 12017 queries used

Test #62:

score: 10
Accepted
time: 11ms
memory: 3656kb

input:

12000
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
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 3602 5727
? 11637 3602 7889
? 11637 3602 5177
? 11637 3602 101
? 11637 101 3602
? 11637 101 8439
? 11637 101 6278
? 11637 101 2883
? 11637 101 7095
? 11637 101 11627
? 11637 101 2681
? 11637 101 2570
? 11637 101 6886
? 11637 101 3074
? 11...

result:

ok ok, 12004 queries used

Test #63:

score: 10
Accepted
time: 28ms
memory: 3692kb

input:

12000
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
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 3602 5727
? 11637 3602 7889
? 11637 3602 5177
? 11637 3602 101
? 11637 101 3602
? 11637 101 8439
? 11637 101 6278
? 11637 101 2883
? 11637 101 7095
? 11637 101 11627
? 11637 101 2681
? 11637 101 2570
? 11637 101 6886
? 11637 101 3074
? 11...

result:

ok ok, 12003 queries used

Test #64:

score: 10
Accepted
time: 11ms
memory: 3880kb

input:

12000
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
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
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
...

output:

? 11637 7543 3602
? 11637 7543 8519
? 11637 8519 7543
? 11637 8519 5727
? 11637 8519 7889
? 11637 8519 5177
? 11637 8519 101
? 11637 8519 8439
? 11637 8519 6278
? 11637 8519 2883
? 11637 8519 7095
? 11637 8519 11627
? 11637 11627 8519
? 11637 11627 2681
? 11637 11627 2570
? 11637 11627 6886
? 11637 ...

result:

ok ok, 12007 queries used

Test #65:

score: 10
Accepted
time: 9ms
memory: 3648kb

input:

12000
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
0
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
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
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
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 3602 5727
? 11637 3602 7889
? 11637 3602 5177
? 11637 3602 101
? 11637 101 3602
? 11637 101 8439
? 11637 101 6278
? 11637 101 2883
? 11637 101 7095
? 11637 7095 101
? 7095 101 11627
? 7095 101 2681
? 7095 101 2570
? 7095 101 6886
? 7095 1...

result:

ok ok, 12010 queries used

Test #66:

score: 10
Accepted
time: 19ms
memory: 3832kb

input:

12000
0
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
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
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 11637 3602 8519
? 11637 8519 3602
? 11637 8519 5727
? 11637 8519 7889
? 11637 8519 5177
? 11637 8519 101
? 11637 8519 8439
? 11637 8519 6278
? 11637 8519 2883
? 11637 8519 7095
? 11637 8519 11627
? 11637 11627 8519
? 11637 11627 2681
? 11637 11627 2570
? 11637 1...

result:

ok ok, 12007 queries used

Test #67:

score: 10
Accepted
time: 9ms
memory: 3864kb

input:

12000
0
0
1
1
1
1
0
0
1
1
0
1
1
1
1
0
1
1
1
1
0
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
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
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
...

output:

? 11637 7543 3602
? 11637 3602 7543
? 3602 7543 8519
? 3602 7543 5727
? 3602 7543 7889
? 3602 7543 5177
? 3602 7543 101
? 3602 101 7543
? 101 7543 8439
? 101 7543 6278
? 101 7543 2883
? 101 2883 7543
? 101 2883 7095
? 101 2883 11627
? 101 2883 2681
? 101 2883 2570
? 101 2570 2883
? 101 2570 6886
? 1...

result:

ok ok, 12013 queries used

Subtask #6:

score: 4
Accepted

Test #68:

score: 4
Accepted
time: 33ms
memory: 3916kb

input:

20000
0
1
1
1
0
0
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
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
1
1
1
1
0
0
1
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 19884 19180
? 11637 19180 19884
? 19180 19884 19378
? 19180 19884 101
? 19180 19884 8439
? 19180 19884 6278
? 19180 19884 17228
? 19180 19884 13298
? 19180 19884 11627
? 19180 19884 17653
? 19180 19884 14407
? 19180 ...

result:

ok ok, 20013 queries used

Test #69:

score: 4
Accepted
time: 10ms
memory: 3604kb

input:

20000
0
0
0
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 19884 8519 5727
? 19884 8519 19180
? 19884 8519 19378
? 19884 8519 101
? 19884 8519 8439
? 19884 8519 6278
? 19884 6278 8519
? 19884 6278 17228
? 19884 6278 13298
? 19884 6278 11627
? 19884 11627 6278
? 11627 6278 17653
? 11...

result:

ok ok, 20009 queries used

Test #70:

score: 4
Accepted
time: 22ms
memory: 3608kb

input:

20000
1
0
1
0
0
0
0
1
0
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
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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 7543 8519
? 11637 8519 7543
? 11637 8519 5727
? 11637 5727 8519
? 5727 8519 19180
? 5727 19180 8519
? 19180 8519 19378
? 19180 8519 101
? 19180 101 8519
? 101 8519 8439
? 101 8519 6278
? 101 8519 17228
? 101 8519 13298
? 101 8519 11627
? 101 8519 17653
? 101 8519 14407
? 1...

result:

ok ok, 20016 queries used

Test #71:

score: 4
Accepted
time: 9ms
memory: 3692kb

input:

20000
0
1
1
0
0
0
0
1
1
1
0
0
1
1
1
1
1
1
0
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
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
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:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 5727 19884
? 5727 19884 19180
? 5727 19180 19884
? 19180 19884 19378
? 19180 19884 101
? 19180 19884 8439
? 19180 19884 6278
? 19180 6278 19884
? 6278 19884 17228
? 6278 19884 13298
? 6278 19884 11627
? 6278 19884 17...

result:

ok ok, 20023 queries used

Test #72:

score: 4
Accepted
time: 22ms
memory: 3612kb

input:

20000
0
1
0
1
1
1
1
1
1
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 8519 19884
? 11637 8519 5727
? 11637 8519 19180
? 11637 8519 19378
? 11637 8519 101
? 11637 8519 8439
? 11637 8519 6278
? 11637 6278 8519
? 11637 6278 17228
? 11637 6278 13298
? 11637 6278 11627
? 11637 6278 17653
? 11637 6278 14407
? ...

result:

ok ok, 20009 queries used

Test #73:

score: 4
Accepted
time: 19ms
memory: 3724kb

input:

20000
0
0
1
0
1
1
0
1
1
1
0
0
1
1
0
0
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
1
1
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
0
1
1
1
1
1
1
1
0
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 19378 5727
? 19884 19378 101
? 19884 19378 8439
? 19884 19378 6278
? 19884 6278 19378
? 6278 19378 17228
? 6278 19378 13298
? 6278 19378 11627
? 6278 11627 19378
...

result:

ok ok, 20016 queries used

Test #74:

score: 4
Accepted
time: 26ms
memory: 3628kb

input:

20000
0
0
1
1
1
0
1
1
1
0
0
1
0
0
1
1
0
0
1
0
0
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
0
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
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 7543 19180
? 19884 7543 19378
? 19884 19378 7543
? 19884 19378 101
? 19884 19378 8439
? 19884 19378 6278
? 19884 6278 19378
? 6278 19378 17228
? 6278 19378 13298
? 6278 13298 19378
? 13298 19378 11627
? 13298 19378 176...

result:

ok ok, 20021 queries used

Test #75:

score: 4
Accepted
time: 36ms
memory: 3660kb

input:

20000
0
0
0
1
0
0
1
1
1
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
1
0
1
0
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
0
0
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
1
1
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 19884 8519 5727
? 19884 5727 8519
? 5727 8519 19180
? 5727 8519 19378
? 5727 8519 101
? 5727 8519 8439
? 5727 8519 6278
? 5727 8519 17228
? 5727 17228 8519
? 17228 8519 13298
? 17228 8519 11627
? 17228 8519 17653
? 17228 851...

result:

ok ok, 20021 queries used

Test #76:

score: 4
Accepted
time: 17ms
memory: 3892kb

input:

20000
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 7543 8519
? 11637 8519 7543
? 8519 7543 5727
? 8519 7543 19180
? 8519 7543 19378
? 8519 7543 101
? 8519 7543 8439
? 8519 7543 6278
? 8519 7543 17228
? 8519 7543 13298
? 8519 13298 7543
? 13298 7543 11627
? 13298 7543 17653
? 13298 7543 14407
? 13298 7543 13143
? 13298 1314...

result:

ok ok, 20014 queries used

Test #77:

score: 4
Accepted
time: 35ms
memory: 3560kb

input:

20000
0
1
0
1
0
0
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
0
1
1
1
1
1
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 8519 19884
? 11637 8519 5727
? 11637 5727 8519
? 5727 8519 19180
? 5727 8519 19378
? 5727 8519 101
? 5727 8519 8439
? 5727 8519 6278
? 5727 8519 17228
? 5727 8519 13298
? 5727 13298 8519
? 5727 13298 11627
? 5727 13298 17653
? 5727 132...

result:

ok ok, 20019 queries used

Test #78:

score: 4
Accepted
time: 16ms
memory: 3692kb

input:

20000
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
0
1
1
1
1
1
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 8519 7543 5727
? 8519 7543 19180
? 8519 7543 19378
? 8519 7543 101
? 8519 7543 8439
? 8519 7543 6278
? 8519 7543 17228
? 8519 7543 13298
? 8519 7543 11627
? 8519 7543 17653
? 8519 7543 14407
? 8519 7543 13143
? 8519 7543 307...

result:

ok ok, 20014 queries used

Test #79:

score: 4
Accepted
time: 30ms
memory: 3844kb

input:

20000
0
1
0
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
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
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:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 8519 19884
? 11637 8519 5727
? 11637 8519 19180
? 11637 19180 8519
? 19180 8519 19378
? 19180 8519 101
? 19180 8519 8439
? 19180 8519 6278
? 19180 8519 17228
? 19180 8519 13298
? 19180 13298 8519
? 13298 8519 11627
? 13298 8519 17653
?...

result:

ok ok, 20009 queries used

Test #80:

score: 4
Accepted
time: 30ms
memory: 3868kb

input:

20000
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
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 19884 19180
? 11637 19884 19378
? 11637 19378 19884
? 19378 19884 101
? 19378 19884 8439
? 19378 19884 6278
? 19378 19884 17228
? 19378 19884 13298
? 19378 19884 11627
? 19378 19884 17653
? 19378 19884 14407
? 19378 ...

result:

ok ok, 20011 queries used

Test #81:

score: 4
Accepted
time: 11ms
memory: 3696kb

input:

20000
0
0
0
0
0
0
1
1
0
1
1
1
1
1
1
1
1
1
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 8519 7543 5727
? 8519 5727 7543
? 5727 7543 19180
? 5727 7543 19378
? 5727 7543 101
? 5727 101 7543
? 5727 101 8439
? 5727 101 6278
? 5727 101 17228
? 5727 101 13298
? 5727 101 11627
? 5727 101 17653
? 5727 101 14407
? 5727 ...

result:

ok ok, 20016 queries used

Test #82:

score: 4
Accepted
time: 12ms
memory: 3688kb

input:

20000
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 5727 101
? 19884 101 5727
? 19884 101 8439
? 19884 101 6278
? 19884 101 17228
? 19884 101 13298
? 19884 101 11627
? 19884 101 17653
? 19884 101 14407
? 19884 101 ...

result:

ok ok, 20012 queries used

Test #83:

score: 4
Accepted
time: 34ms
memory: 3688kb

input:

20000
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 5727 101
? 19884 101 5727
? 19884 101 8439
? 19884 101 6278
? 19884 101 17228
? 19884 101 13298
? 19884 101 11627
? 19884 101 17653
? 19884 101 14407
? 19884 101 ...

result:

ok ok, 20012 queries used

Test #84:

score: 4
Accepted
time: 21ms
memory: 3684kb

input:

20000
0
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 7543 19180
? 19884 19180 7543
? 19884 19180 19378
? 19884 19180 101
? 19884 19180 8439
? 19884 19180 6278
? 19884 19180 17228
? 19884 19180 13298
? 19884 19180 11627
? 19884 19180 17653
? 19884 19180 14407
? 19884 1918...

result:

ok ok, 20008 queries used

Test #85:

score: 4
Accepted
time: 20ms
memory: 3612kb

input:

20000
0
0
0
0
0
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
1
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 8519 7543 5727
? 8519 5727 7543
? 8519 5727 19180
? 8519 5727 19378
? 8519 5727 101
? 8519 101 5727
? 8519 101 8439
? 8519 101 6278
? 8519 101 17228
? 8519 101 13298
? 8519 101 11627
? 8519 101 17653
? 8519 101 14407
? 8519 ...

result:

ok ok, 20018 queries used

Test #86:

score: 4
Accepted
time: 32ms
memory: 3688kb

input:

20000
0
0
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
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
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 8519 7543
? 19884 8519 5727
? 19884 8519 19180
? 19884 8519 19378
? 19884 8519 101
? 19884 8519 8439
? 19884 8519 6278
? 19884 8519 17228
? 19884 8519 13298
? 19884 13298 8519
? 19884 13298 11627
? 19884 13298 17653
? 19884 13298 14407
...

result:

ok ok, 20015 queries used

Test #87:

score: 4
Accepted
time: 22ms
memory: 3724kb

input:

20000
1
0
0
0
0
1
1
0
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 7543 8519
? 11637 8519 7543
? 8519 7543 5727
? 8519 5727 7543
? 5727 7543 19180
? 5727 7543 19378
? 5727 7543 101
? 5727 101 7543
? 101 7543 8439
? 101 7543 6278
? 101 6278 7543
? 101 6278 17228
? 101 6278 13298
? 101 6278 11627
? 101 6278 17653
? 101 6278 14407
? 101 6278...

result:

ok ok, 20016 queries used

Test #88:

score: 4
Accepted
time: 8ms
memory: 3680kb

input:

20000
0
0
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
1
1
0
1
1
0
1
0
1
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 5727 101
? 19884 5727 8439
? 19884 5727 6278
? 19884 6278 5727
? 19884 6278 17228
? 19884 6278 13298
? 19884 13298 6278
? 19884 13298 11627
? 19884 13298 17653
? ...

result:

ok ok, 20016 queries used

Test #89:

score: 4
Accepted
time: 19ms
memory: 3916kb

input:

20000
0
0
1
0
0
1
1
0
0
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 5727 7543 19180
? 5727 7543 19378
? 5727 7543 101
? 5727 101 7543
? 101 7543 8439
? 101 7543 6278
? 101 6278 7543
? 101 6278 17228
? 101 6278 13298
? 101 6278 11627
? 101 6278 17653
? 101 6278 14407
? 101 6...

result:

ok ok, 20017 queries used

Test #90:

score: 4
Accepted
time: 12ms
memory: 3608kb

input:

20000
0
0
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
1
1
0
1
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
1
1
1
1
1
1
1
1
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 5727 101
? 19884 101 5727
? 19884 101 8439
? 19884 101 6278
? 19884 101 17228
? 19884 101 13298
? 19884 101 11627
? 19884 101 17653
? 19884 101 14407
? 19884 101 ...

result:

ok ok, 20009 queries used

Test #91:

score: 4
Accepted
time: 44ms
memory: 3680kb

input:

20000
0
0
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
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
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
...

output:

? 11637 7543 19884
? 11637 19884 7543
? 19884 7543 8519
? 19884 7543 5727
? 19884 5727 7543
? 19884 5727 19180
? 19884 5727 19378
? 19884 5727 101
? 19884 101 5727
? 19884 101 8439
? 19884 101 6278
? 19884 101 17228
? 19884 101 13298
? 19884 101 11627
? 19884 101 17653
? 19884 101 14407
? 19884 101 ...

result:

ok ok, 20011 queries used

Test #92:

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

input:

20000
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
1
1
1
1
1
1
1
1
1
1
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 19884 19180
? 11637 19180 19884
? 19180 19884 19378
? 19180 19378 19884
? 19378 19884 101
? 19378 19884 8439
? 19378 19884 6278
? 19378 19884 17228
? 19378 19884 13298
? 19378 19884 11627
? 19378 19884 17653
? 19378 ...

result:

ok ok, 20009 queries used

Test #93:

score: 4
Accepted
time: 13ms
memory: 3684kb

input:

20000
1
1
0
0
1
1
0
0
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
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
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:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 5727 7543
? 5727 7543 19180
? 5727 7543 19378
? 5727 7543 101
? 5727 101 7543
? 101 7543 8439
? 101 7543 6278
? 101 6278 7543
? 101 6278 17228
? 101 6278 13298
? 101 6278 11627
? 101 6278 17653
? 101 6278 14407
? 101 6278 13143
? 101 627...

result:

ok ok, 20020 queries used

Test #94:

score: 4
Accepted
time: 6ms
memory: 3728kb

input:

20000
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
0
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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 11637 7543 19884
? 11637 19884 7543
? 11637 19884 8519
? 11637 19884 5727
? 11637 19884 19180
? 11637 19180 19884
? 19180 19884 19378
? 19180 19884 101
? 19180 19884 8439
? 19180 19884 6278
? 19180 19884 17228
? 19180 19884 13298
? 19180 19884 11627
? 19180 19884 17653
? 19180 19884 14407
? 19180 ...

result:

ok ok, 20010 queries used

Test #95:

score: 4
Accepted
time: 32ms
memory: 3848kb

input:

20000
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
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
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
1
1
1
1
1
1
1
1
1
1
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
...

output:

? 11637 7543 19884
? 11637 7543 8519
? 11637 7543 5727
? 11637 5727 7543
? 5727 7543 19180
? 5727 7543 19378
? 5727 7543 101
? 5727 101 7543
? 101 7543 8439
? 101 7543 6278
? 101 7543 17228
? 101 7543 13298
? 101 7543 11627
? 101 7543 17653
? 101 7543 14407
? 101 7543 13143
? 101 7543 3074
? 101 754...

result:

ok ok, 20022 queries used

Extra Test:

score: 0
Extra Test Passed