QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#811851#9783. Duloc NetworkI_Love_Sonechka#WA 18ms4848kbC++203.1kb2024-12-13 03:32:322024-12-13 03:32:33

Judging History

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

  • [2024-12-13 03:32:33]
  • 评测
  • 测评结果:WA
  • 用时:18ms
  • 内存:4848kb
  • [2024-12-13 03:32:32]
  • 提交

answer

#include <complex.h>
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pi pair<int, int>
#define pb push_back

using namespace std;
using ll = long long;

template<typename T_container, typename T = typename enable_if
    <!is_same<T_container, string>::value, typename
    T_container::value_type>::type>

ostream& operator<<(ostream &os, const T_container &v) {
    os << '{';
    string sep;
    for(const T &x : v) {
        os << sep << x;
        sep = ", ";
    }
    return os << '}';
}


void dbg_out(){cerr<<endl;}
template <typename Head, typename... Tail>void dbg_out(Head H
    , Tail... T){cerr << ' ' << H; dbg_out(T...); }

#define dbg(...) dbg_out(__VA_ARGS__)

// #define TEST_CASES
#define vt vector

const int amax = 12;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void get() {
    int n = 200;
    double res = 0;
    for(int i = 1; i < n; ++i) {
        double P = 1;
        for(int j = 1; j <= i; ++j) {
            P /= i;
            res += P * j;
            P *= (i-1);
        }
    }
    cout << 2 * res << '\n';
}

const int MAX_QUERIES = 3500;

void solve() {
    int n; cin >> n;
    map<string, int> queries;
    auto Ask = [&](string s) -> int {
        if(queries.count(s)) {
            return queries[s];
        }
        if(queries.size() == MAX_QUERIES) {
            cout << "! " << rng() % 2 << endl;
            exit(0);
        }
        assert(queries.size() < MAX_QUERIES);
        cout << "? " << s << endl;
        fflush(stdout);
        int ret; cin >> ret;
        return queries[s] = ret;
    };
    string S;
    for(int i = 0; i < n; ++i) {
        S.push_back('0');
    }
    string T = S;
    S[rng()%n] = '1';
    for(int i = 1; i < n; ++i) {
        vt<int> other;
        for(int j = 0; j < n; ++j) if(S[j] == '0') {
            other.push_back(j);
        }
        int value = Ask(S);
        if(value == n - i) {
            break;
        }
        if(value == 0) {
            cout << "! 0" << endl;
            fflush(stdout);
            return ;
        }
        // stable_sort(other.begin(), other.end(), [&](int x, int y) -> bool {
        //     T[x] = '1';
        //     auto ask_x = Ask(T);
        //     T[x] = '0';
        //     T[y] = '1';
        //     auto ask_y = Ask(T);
        //     T[y] = '0';
        //     return ask_x < ask_y;
        // });
        shuffle(other.begin(), other.end(), rng);
        for(auto u: other) {
            T[u] = '1';
            int u_value = Ask(T);
            T[u] = '0';
            S[u] = '1';
            int u_and_s = Ask(S);
            S[u] = '0';
            int s_value = Ask(S);
            int inter = s_value + u_value - u_and_s;
            if(inter != 0) {
                S[u] = '1';
                break;
            }
        }
    }
    cout << "! 1" << endl;
    fflush(stdout);
}

int main() {
    // cin.tie(0)->sync_with_stdio(0);
int tt = 1;
#ifdef TEST_CASES
    cin >> tt;
#endif
    while(tt--)
        solve();
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3664kb

input:

4
2
1
2

output:

? 0001
? 1000
? 1001
! 1

result:

ok Correct answer with 3 queries.

Test #2:

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

input:

2
0

output:

? 01
! 0

result:

ok Correct answer with 1 queries.

Test #3:

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

input:

4
3

output:

? 0100
! 1

result:

ok Correct answer with 1 queries.

Test #4:

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

input:

2
0

output:

? 01
! 0

result:

ok Correct answer with 1 queries.

Test #5:

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

input:

50
1
1
2
3
4
2
3
3
4
1
2
1
2
2
3
3
4
2
3
2
3
2
3
1
2
1
2
4
5
2
3
1
2
2
3
4
5
1
2
3
4
1
2
3
4
1
2
1
2
1
2
4
5
3
4
2
3
4
5
1
2
3
4
1
2
1
2
2
3
4
5
2
3
1
1
1
1
3
4
4
2
4
5
1
2
3
4
5
3
3
2
3
0

output:

? 00000000000000000001000000000000000000000000000000
? 00010000000000000000000000000000000000000000000000
? 00010000000000000001000000000000000000000000000000
? 00000010000000000000000000000000000000000000000000
? 00000010000000000001000000000000000000000000000000
? 000000000000000000000000000000010...

result:

ok Correct answer with 93 queries.

Test #6:

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

input:

50
15
8
19
10
25
5
25
10
29
10
34
15
36
7
36
11
37
8
36
9
35
10
36
9
36
9
35
11
34
10
33
11
32
12
31
14
30
9
29
11
28
10
27
9
27

output:

? 00000000000000000000100000000000000000000000000000
? 00000000100000000000000000000000000000000000000000
? 00000000100000000000100000000000000000000000000000
? 00000000000000000000000000000000000000000001000000
? 00000000100000000000100000000000000000000001000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 45 queries.

Test #7:

score: 0
Accepted
time: 2ms
memory: 3764kb

input:

50
1
3
3
2
5
2
5
1
4
2
5
3
6
1
4
3
6
3
6
4
3
1
4
1
4
2
5
3
6
3
6
1
4
1
4
3
4
5
5
1
6
1
6
8
1
6
7
8
1
7
8
4
7
10
4
9
12
12
2
10
11
12
1
13
13
11
4
13
13
14
3
13
12
13
1
13
4
11
1
12
1
10
11
11
9
10
10
10
1
10
1
10
11
10
3
8
10
9
7
1
7
8
1
8
8
3
7
2
7
8
8
2
8
9
9
11
1
9
9
7
8
8
8
8
8
8
10
1
6
7
7
3
8
...

output:

? 00000000000000000000000000000000000000000010000000
? 01000000000000000000000000000000000000000000000000
? 01000000000000000000000000000000000000000010000000
? 00000000000000000000000010000000000000000000000000
? 01000000000000000000000010000000000000000010000000
? 000000000000000000000000000010000...

result:

ok Correct answer with 174 queries.

Test #8:

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

input:

50
9
4
13
8
16
5
17
8
23
13
28
10
30
8
31
5
33
6
33
5
35
8
35
12
35
12
34
14
34
8
33
2
32
9
31
10
30
6
29
4
28
9
27
8
28

output:

? 00000000000000001000000000000000000000000000000000
? 00000000000000000000000000000100000000000000000000
? 00000000000000001000000000000100000000000000000000
? 00000000000000000000001000000000000000000000000000
? 00000000000000001000001000000000000000000000000000
? 000000000000000000000000000000000...

result:

ok Correct answer with 45 queries.

Test #9:

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

input:

50
1
1
2
1
2
1
2
2
3
1
2
1
2
1
2
2
3
1
2
1
2
1
2
1
2
1
2
1
2
2
3
3
4
1
2
2
3
2
3
1
2
1
2
1
2
1
2
2
3
1
2
3
4
1
2
1
2
2
3
3
4
1
2
5
6
1
2
1
2
2
1
3
6
4
1
2
3
2
2
3
3
4
1
2
2
1
2
2
3
3
2
3
2
2
2
1
2
2
4
2
2
2
3
4
1
2
4
2
2
2
4
3
2
2
2
2
3
2
2
1
2
6
2
1
2
2
2
2
2
2
2
2
1
2
3
4
2
2
2
2
3
2
3
2
3
4
3
3
4...

output:

? 00000000000000000000000000000000000000000000000010
? 00000000000000010000000000000000000000000000000000
? 00000000000000010000000000000000000000000000000010
? 00000000000000100000000000000000000000000000000000
? 00000000000000100000000000000000000000000000000010
? 000000000000000000000000010000000...

result:

ok Correct answer with 160 queries.

Test #10:

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

input:

100
3
1
4
1
4
1
4
2
5
2
5
1
4
1
4
1
4
2
5
1
4
1
4
3
6
1
4
3
6
1
4
1
4
1
3
6
1
4
1
4
4
7
1
4
4
1
4
1
4
1
4
2
5
4
7
2
5
1
4
2
5
3
6
2
5
2
5
4
7
2
5
4
1
4
1
4
1
4
4
2
5
4
7
1
4
1
4
1
4
1
4
1
4
4
2
5
1
4
1
4
2
5
2
5
1
4
5
3
6
3
6
4
5
1
4
1
4
5
2
5
4
1
4
4
2
5
3
6
1
4
1
4
2
5
2
5
1
4
2
5
2
2
5
4
3
1
3
5
...

output:

? 0000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00010000000001000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 596 queries.

Test #11:

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

input:

100
12
9
18
16
33
11
39
11
45
8
50
5
50
10
53
5
55
10
57
13
61
11
63
11
64
10
64
11
67
5
70
10
70
10
69
10
70
12
70
8
70
8
70
7
70
13
70
11
69
5
69
9
68
13
67
11
66
8
65
6
65
10
64
9
64
6
65
8
64
9
63
6
62
8
61
6
60
12
59
8
58
7
57
10
56
11
55
9
54
11
53
11
52
7
51
15
50
13
49
16
48
5
47
12
46
5
46

output:

? 0000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000001000000000001000000000000...

result:

ok Correct answer with 107 queries.

Test #12:

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

input:

100
3
5
7
5
10
4
13
1
14
5
17
3
20
8
22
3
22
4
26
3
22
2
24
2
23
3
26
1
24
5
24
2
24
5
29
2
24
4
25
1
26
4
28
7
32
6
33
2
35
3
33
3
36
3
35
4
36
4
36
2
37
2
38
3
37
37
5
38
2
39
3
40
4
41
4
40
4
43
3
42
2
44
2
42
43
44
6
44
4
44
2
43
3
42
3
41
2
42
44
6
43
42
2
41
3
42
2
41
5
42
3
44
5
44
2
43
4
42
...

output:

? 0000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000010000000100000000000000000000000000000000000000000000...

result:

ok Correct answer with 177 queries.

Test #13:

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

input:

100
3
1
4
1
4
1
4
4
7
1
4
1
4
4
7
2
5
5
8
4
7
2
5
3
6
2
5
1
4
2
5
3
6
2
5
4
7
1
4
2
5
1
4
3
6
2
5
1
4
3
6
1
4
2
5
2
5
1
4
1
4
1
4
4
7
3
6
1
4
2
5
1
4
1
4
2
5
2
5
1
4
1
4
3
6
1
4
2
5
2
5
1
4
2
5
1
4
1
4
4
7
2
5
4
7
1
2
4
1
3
4
3
5
6
4
2
4
1
3
6
4
4
1
3
3
1
3
4
3
1
2
3
1
3
5
3
1
3
4
3
3
4
3
5
6
1
7
9
...

output:

? 0000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000010000000000000100000000000000000000000000000...

result:

ok Correct answer with 456 queries.

Test #14:

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

input:

100
1
1
2
1
2
1
2
3
4
2
3
1
2
1
2
2
3
1
2
4
5
1
2
1
2
1
2
1
2
1
2
3
4
1
2
2
3
5
6
3
4
1
2
1
2
1
2
2
3
1
2
1
2
2
3
2
3
1
2
3
4
3
4
2
3
1
2
2
3
1
2
2
3
2
3
1
2
1
2
1
2
1
0

output:

? 0000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000
? 00000000100000000000000000000000000000000000000000000000000000000000000000000000010000000000...

result:

ok Correct answer with 83 queries.

Test #15:

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

input:

150
2
2
4
1
3
3
5
4
6
3
5
5
7
2
4
3
5
4
6
4
6
3
5
6
8
3
5
7
9
3
5
3
5
3
5
2
4
2
4
4
6
1
3
1
3
3
5
2
4
3
5
4
6
4
6
3
5
2
4
2
4
2
4
2
3
6
9
4
7
4
1
4
1
4
4
7
1
4
2
5
2
5
5
8
4
7
2
5
7
4
1
4
3
5
8
3
7
3
10
11
9
3
10
10
5
12
3
10
3
9
1
10
4
12
1
13
3
15
3
15
5
16
6
20
23
23
22
3
23
4
26
4
29
31
1
32
5
3...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000...

result:

ok Correct answer with 354 queries.

Test #16:

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

input:

150
4
3
7
4
8
4
8
2
6
2
6
2
6
1
5
2
6
3
7
4
8
3
7
2
6
5
7
1
8
2
9
2
9
2
9
4
10
3
13
5
12
3
15
4
16
1
13
5
17
2
14
1
13
4
13
8
20
2
21
23
2
22
2
24
1
23
4
26
1
23
2
24
24
23
3
25
3
28
2
27
26
4
26
3
27
4
31
1
28
4
30
1
31
1
31
31
32
1
31
3
31
6
36
1
37
4
37
1
36
3
38
39
41
40
42
7
43
6
46
1
46
2
46
3...

output:

? 000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000...

result:

ok Correct answer with 327 queries.

Test #17:

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

input:

150
2
4
6
3
5
4
6
3
5
3
5
2
3
3
5
3
8
1
6
1
6
3
7
5
12
2
9
3
10
1
8
4
11
3
10
1
8
1
8
1
8
3
10
1
7
2
9
2
9
3
10
1
8
2
9
1
8
1
8
2
9
2
9
10
8
2
9
4
11
5
11
3
14
5
16
1
12
12
14
1
12
14
4
15
1
12
1
12
4
13
15
14
4
16
17
1
17
4
20
18
2
18
2
16
2
17
3
18
22
1
19
23
19
1
19
3
21
20
1
17
3
19
19
3
21
1
22...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000
? 0000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 428 queries.

Test #18:

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

input:

150
4
2
6
6
10
3
7
7
9
3
12
2
10
1
11
3
13
3
13
4
12
2
14
5
16
2
17
3
19
3
21
2
23
3
23
8
27
3
30
30
1
27
2
26
3
29
5
30
1
31
3
33
3
31
3
33
1
34
1
34
3
35
1
35
1
36
5
34
2
35
2
37
3
38
2
37
2
37
3
38
37
1
36
3
38
2
35
4
39
5
35
36
38
2
37
1
34
2
35
3
36
5
38
2
38
4
41
43
1
43
3
44
2
45
3
47
3
46
2
...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 359 queries.

Test #19:

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

input:

150
1
2
3
2
3
1
2
3
4
3
4
1
2
1
2
1
2
2
3
1
2
5
6
2
3
3
4
3
4
2
3
3
4
1
2
1
2
1
2
1
2
2
3
1
2
1
2
2
3
2
3
1
2
1
2
3
4
1
2
3
4
1
2
2
3
1
2
1
2
1
2
2
3
1
2
3
3
4
1
4
2
5
4
7
2
5
1
4
4
6
2
8
2
8
2
7
3
10
2
9
3
10
8
1
8
8
1
8
2
9
7
10
10
2
9
2
9
10
3
10
3
10
2
9
2
9
2
9
3
10
1
8
2
9
1
8
2
9
3
10
1
8
8
3...

output:

? 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000
? 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000...

result:

ok Correct answer with 731 queries.

Test #20:

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

input:

200
2
3
5
1
3
1
2
2
4
1
3
1
3
1
3
1
3
1
3
2
4
1
3
1
3
2
4
1
3
1
3
2
4
1
3
2
4
1
3
1
3
1
3
1
3
1
3
1
3
1
3
2
4
1
3
1
3
2
4
1
3
3
5
1
3
1
3
1
3
1
3
1
3
1
3
2
4
3
5
1
3
1
3
5
4
1
5
1
5
1
5
1
5
1
5
5
1
5
2
6
5
5
7
1
5
5
1
5
1
5
1
5
4
8
1
5
2
6
1
5
1
5
2
6
5
3
7
1
5
1
3
2
5
1
4
1
4
1
4
4
1
4
1
4
2
5
1
4
...

output:

? 00000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1087 queries.

Test #21:

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

input:

200
1
3
4
2
3
2
3
3
4
4
5
2
3
2
3
2
3
2
3
1
2
2
3
2
3
2
3
1
2
1
2
1
2
1
2
2
3
2
3
2
3
3
4
3
4
2
3
1
2
1
2
2
3
3
4
2
1
3
3
1
2
1
2
1
2
5
4
5
3
4
2
3
2
3
2
3
1
2
2
3
1
2
4
4
6
5
9
2
6
2
6
7
1
5
3
4
1
5
5
9
1
5
7
4
4
8
1
5
5
2
6
5
6
1
3
2
5
4
5
1
4
3
6
1
4
3
6
5
5
5
2
5
4
7
1
4
5
7
1
4
1
4
6
2
5
1
3
4
...

output:

? 00000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000...

result:

ok Correct answer with 1317 queries.

Test #22:

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

input:

200
3
1
4
2
5
1
4
2
5
2
5
4
7
1
4
3
6
1
4
2
5
1
4
2
5
1
4
2
5
2
5
2
5
2
5
1
4
1
4
1
4
2
3
1
4
1
4
1
4
1
4
2
5
3
6
6
9
1
4
2
5
1
4
3
6
2
5
1
4
2
5
3
6
1
4
5
2
5
1
4
3
6
5
8
4
7
1
4
1
4
3
6
1
4
1
4
2
5
3
6
1
4
4
1
4
1
4
1
4
1
4
5
2
4
5
9
2
6
2
6
3
7
1
5
5
1
5
2
4
5
1
5
5
4
8
1
5
1
4
1
5
1
5
5
4
8
2
6
...

output:

? 00000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1476 queries.

Test #23:

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

input:

200
3
2
5
1
4
1
4
2
5
2
5
4
7
3
6
1
4
1
4
1
3
1
4
2
5
1
4
7
1
4
1
4
1
4
3
6
2
5
4
6
2
8
7
4
10
2
8
1
7
1
7
3
9
4
10
1
7
2
8
3
9
2
8
1
7
2
8
2
8
3
9
3
9
2
8
1
7
2
8
1
7
1
7
3
9
1
7
2
8
1
7
3
9
1
7
1
7
1
7
3
9
1
7
1
7
1
7
2
8
4
10
3
9
2
8
1
7
1
7
4
10
2
6
3
9
4
10
1
7
4
10
8
1
7
2
8
1
7
9
9
9
2
8
2
8
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000...

result:

ok Correct answer with 1035 queries.

Test #24:

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

input:

200
2
3
5
2
4
3
5
4
6
2
4
4
6
5
7
3
5
5
7
2
4
3
5
4
6
4
6
1
3
3
5
2
4
3
5
3
5
5
7
4
6
5
7
2
4
2
4
3
5
2
4
2
4
2
4
3
5
1
3
3
5
3
5
4
6
4
6
1
3
3
5
2
4
3
5
1
3
3
5
2
4
4
6
3
5
2
4
3
5
3
5
4
6
1
3
1
3
2
4
3
5
1
3
2
4
3
5
2
4
1
3
2
4
3
5
2
4
5
7
3
4
2
6
4
8
3
7
1
5
7
9
1
5
3
7
2
6
1
5
1
5
2
6
6
1
5
2
6
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 540 queries.

Test #25:

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

input:

200
3
5
7
2
9
9
16
4
11
7
14
3
9
2
11
1
10
3
12
6
13
7
18
6
21
5
25
4
28
4
31
4
33
4
36
5
40
4
42
6
47
6
52
4
53
2
54
3
56
2
57
3
58
4
60
5
62
10
68
8
75
6
80
1
80
7
80
2
81
4
82
2
82
5
83
7
85
7
89
2
88
1
89
3
90
1
91
3
91
4
92
3
92
8
91
4
92
4
92
2
94
4
93
5
93
3
92
3
93
8
96
8
97
5
96
8
95
3
95
3...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000
? 00010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 333 queries.

Test #26:

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

input:

200
4
2
6
4
8
7
10
5
15
4
13
3
16
4
17
2
15
5
18
2
14
3
17
5
19
3
17
6
20
7
20
23
4
24
1
21
5
25
2
22
9
28
4
31
4
32
34
6
37
4
39
3
41
5
44
5
47
6
53
2
49
6
51
2
53
5
56
7
57
5
59
9
66
2
68
5
69
5
72
3
74
11
79
9
86
5
90
6
95
94
94
3
93
3
95
2
97
7
96
5
95
4
97
99
3
100
3
97
4
99
100
4
100
101
102
4...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 436 queries.

Test #27:

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

input:

200
3
2
5
3
6
6
9
3
6
2
5
3
6
4
5
6
11
4
9
2
7
4
9
3
8
7
4
9
5
10
3
8
3
8
4
9
1
6
4
9
2
7
4
9
5
10
2
7
6
11
4
9
8
12
2
14
2
14
6
18
3
15
3
15
16
7
17
2
19
5
22
4
21
4
21
5
22
2
19
5
22
4
20
6
25
1
26
2
27
2
27
6
27
1
28
31
3
33
2
35
5
38
8
39
3
42
3
40
3
43
3
40
6
43
2
44
5
48
50
3
53
2
50
53
52
2
5...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 478 queries.

Test #28:

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

input:

200
2
12
14
2
4
4
6
6
8
8
10
9
11
3
5
7
9
9
11
1
3
4
6
6
8
3
5
6
8
6
8
6
7
9
15
22
6
28
3
25
5
27
5
27
6
26
6
30
2
32
5
34
37
4
41
2
38
4
40
6
46
4
42
3
43
49
4
51
10
54
6
59
6
62
3
65
5
65
2
66
3
68
3
70
73
74
5
77
3
80
3
79
6
81
6
86
5
86
94
3
96
2
96
8
99
4
98
6
98
9
102
5
102
3
104
5
104
3
104
4...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 426 queries.

Test #29:

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

input:

200
6
6
12
6
12
6
12
5
10
2
12
4
14
2
12
2
12
3
13
5
15
4
14
2
12
8
18
6
16
5
13
6
19
2
15
5
18
3
15
3
18
3
17
4
19
2
21
5
24
4
23
6
25
4
22
4
25
5
28
2
30
6
31
4
35
10
38
2
40
4
42
41
5
46
3
43
6
46
3
49
7
51
4
55
55
4
55
5
56
3
53
6
57
5
58
6
61
6
65
5
66
7
68
2
70
5
73
4
71
75
7
77
2
78
2
80
7
81...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 350 queries.

Test #30:

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

input:

200
1
3
4
1
2
1
2
2
3
1
2
2
3
3
4
1
2
3
4
1
2
2
3
3
4
1
2
1
2
2
3
3
4
2
3
4
5
3
4
2
3
1
2
1
2
1
2
2
3
3
4
1
2
2
3
1
2
2
3
2
3
3
4
1
2
2
2
2
4
2
4
1
3
2
4
1
3
1
3
2
4
2
4
3
2
4
1
3
3
5
2
4
3
5
5
3
1
3
2
4
3
3
5
1
3
1
3
2
4
2
4
2
4
1
3
4
3
1
3
1
3
1
3
5
7
1
3
3
5
3
3
5
5
2
4
1
3
4
6
2
4
2
4
4
2
4
4
6
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000...

result:

ok Correct answer with 1012 queries.

Test #31:

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

input:

200
1
2
3
3
4
2
2
3
5
1
3
2
4
2
4
2
4
2
4
2
4
1
3
1
3
3
5
3
5
2
4
1
3
2
4
1
3
2
4
4
6
1
3
1
3
1
3
3
5
3
5
2
4
1
3
2
4
1
3
3
5
2
4
1
3
3
5
2
4
2
4
2
4
3
5
3
2
1
3
1
3
2
4
2
4
3
5
2
4
2
4
2
4
2
4
2
4
2
4
1
3
2
4
1
3
2
4
2
4
2
4
2
4
4
6
2
4
2
4
2
4
1
3
1
3
3
5
3
5
5
1
3
4
5
2
4
1
3
2
4
4
2
4
3
5
2
4
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1426 queries.

Test #32:

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

input:

200
3
2
5
2
5
1
4
2
5
2
5
1
4
2
5
1
4
1
4
1
4
2
5
1
4
2
5
1
4
2
5
3
6
1
4
1
4
1
4
2
5
2
5
2
5
4
7
2
5
4
7
1
4
3
6
2
5
2
5
1
4
1
4
1
4
3
6
1
4
2
5
3
6
1
4
3
6
1
4
1
4
2
5
5
8
1
4
2
5
4
7
2
5
1
4
2
5
3
6
3
6
2
3
4
2
5
4
3
6
4
7
4
7
1
4
1
4
3
6
5
3
6
5
4
7
2
5
2
5
1
4
1
4
2
5
2
3
1
4
2
5
1
4
4
7
5
1
4
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1317 queries.

Test #33:

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

input:

200
1
1
2
2
3
1
2
1
2
3
4
1
2
2
3
3
4
2
3
1
2
4
5
1
2
2
3
3
4
1
2
1
2
4
5
1
2
2
3
1
2
3
4
2
3
5
6
1
2
2
3
3
3
3
6
3
6
1
4
1
4
1
4
1
4
2
5
3
6
1
4
2
5
4
2
5
1
4
2
5
1
4
3
6
3
6
4
7
2
4
1
5
2
6
1
5
2
6
1
5
1
5
6
1
5
5
1
5
4
8
6
3
7
3
7
5
5
2
6
5
6
7
1
7
1
7
3
9
7
1
7
3
9
3
9
9
1
7
1
7
3
9
8
1
5
6
1
6
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000...

result:

ok Correct answer with 1068 queries.

Test #34:

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

input:

200
3
1
4
2
5
3
6
2
5
3
6
1
4
3
6
1
4
5
8
2
5
4
7
2
5
2
5
2
5
4
7
2
5
1
4
3
6
2
5
3
6
1
4
3
6
1
4
1
4
1
4
1
4
1
4
3
6
1
4
2
5
2
5
3
6
3
6
1
4
2
5
2
5
2
5
1
4
3
6
2
5
1
4
2
5
1
4
1
4
2
5
2
5
2
5
2
5
4
7
3
6
2
5
1
4
5
8
2
5
4
6
1
7
2
8
10
2
8
1
7
1
7
7
2
8
8
7
4
10
1
7
4
10
1
7
11
9
8
2
8
3
9
1
7
7
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 919 queries.

Test #35:

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

input:

200
2
3
5
2
4
2
4
1
3
3
5
3
5
2
4
2
4
2
4
3
5
2
4
3
5
3
5
2
4
3
4
3
7
2
6
2
6
3
7
2
6
3
7
3
7
2
6
3
7
2
6
1
5
3
7
2
6
2
6
3
4
3
7
2
6
3
7
2
6
2
6
6
2
6
3
7
2
6
7
2
6
1
5
2
6
7
6
3
7
3
7
2
6
3
7
2
6
2
6
2
6
2
6
2
6
3
7
2
6
2
6
2
6
2
6
2
6
1
5
3
7
3
7
6
2
6
6
3
7
6
2
6
2
6
2
6
2
6
3
7
2
6
3
7
2
6
3
7
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 838 queries.

Test #36:

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

input:

200
2
3
5
2
4
2
4
1
3
3
5
3
5
3
5
2
4
3
5
3
5
2
4
2
4
3
5
3
5
2
4
2
4
2
4
2
4
2
4
3
5
2
4
2
4
2
4
2
4
3
5
3
5
2
4
3
5
2
4
2
4
3
5
3
5
2
2
2
4
4
2
3
2
5
5
2
5
6
2
5
3
6
3
6
6
3
6
2
5
2
5
5
2
5
3
6
6
3
6
2
5
2
5
2
5
5
3
6
2
5
2
5
2
5
2
5
6
2
5
1
4
2
5
3
6
3
6
2
5
2
5
2
5
2
5
2
5
2
5
3
6
2
5
3
6
3
6
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010
? 00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1040 queries.

Test #37:

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

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
1
3
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 3500 queries.

Test #38:

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

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
1
3
2
4
2
2
2
4
2
4
2
4
2
4
2
4
2
4
4
1
3
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
4
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
...

output:

? 00000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 2568 queries.

Test #39:

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

input:

200
1
2
3
2
3
1
2
1
2
1
2
4
5
2
3
2
3
2
3
1
2
2
3
1
2
3
4
2
3
1
2
3
4
1
2
2
2
2
4
2
4
4
6
3
5
3
5
2
4
2
4
2
4
5
7
3
5
3
5
3
4
3
5
1
3
1
3
5
4
6
3
5
1
3
1
3
1
3
1
3
2
4
4
6
1
3
1
3
1
3
2
4
4
6
1
3
1
3
1
3
1
3
2
4
2
4
2
4
5
3
5
1
3
5
7
2
4
3
5
1
3
3
5
1
3
3
5
1
3
2
4
1
3
3
5
1
3
2
4
2
4
2
4
2
4
3
5
1
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1782 queries.

Test #40:

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

input:

200
1
2
3
1
2
3
4
4
5
1
2
2
3
1
2
1
2
1
2
2
3
1
2
3
4
1
2
1
2
1
2
2
3
3
4
3
3
4
7
2
5
1
4
1
4
1
4
1
4
2
5
4
7
4
7
2
5
2
5
2
5
4
7
4
5
5
10
2
7
4
9
2
7
1
6
1
6
3
8
1
6
3
8
2
7
1
6
5
10
2
7
1
6
3
8
9
2
7
6
3
8
2
7
3
8
2
6
3
9
3
9
1
7
1
7
4
10
7
1
7
1
7
2
8
10
3
9
1
7
3
9
9
2
8
2
8
7
2
8
11
11
3
9
2
8
...

output:

? 00000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1793 queries.

Test #41:

score: 0
Accepted
time: 2ms
memory: 4084kb

input:

200
1
3
4
3
4
1
2
2
2
3
5
1
3
2
4
1
3
1
3
2
4
3
5
3
5
1
3
3
5
1
3
2
4
1
3
1
3
3
5
4
6
2
4
3
5
1
3
1
3
1
3
2
4
4
6
2
4
2
4
4
6
2
4
2
4
1
3
6
8
2
4
1
3
2
4
3
2
4
3
5
3
5
1
3
3
3
1
4
3
6
1
4
2
5
5
1
4
3
6
2
5
1
4
4
1
4
5
4
1
4
9
6
4
1
4
1
4
2
5
4
3
6
2
5
3
6
4
7
1
4
1
4
6
9
2
5
1
4
1
4
1
4
1
4
3
6
2
5
...

output:

? 00000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000...

result:

ok Correct answer with 1392 queries.

Test #42:

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

input:

200
2
4
6
1
3
1
3
1
3
1
3
2
4
2
4
2
4
2
4
3
5
2
4
2
4
4
6
3
5
3
5
3
5
1
3
1
3
1
3
3
5
2
4
3
5
1
3
3
5
2
4
2
4
2
4
2
4
2
4
1
3
1
3
4
6
1
3
3
5
1
3
1
3
3
5
1
3
1
3
2
4
2
4
2
4
2
4
1
3
1
3
2
4
5
7
2
4
1
3
2
4
2
4
1
3
2
4
4
6
1
3
4
6
2
4
2
4
1
3
3
5
1
3
3
5
1
3
2
4
2
4
3
5
2
4
4
6
1
3
2
4
3
5
1
3
3
5
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1529 queries.

Test #43:

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

input:

200
2
3
5
2
4
3
5
2
4
4
6
2
4
1
3
1
3
3
5
2
4
2
4
1
3
2
4
2
4
4
6
2
4
2
4
3
5
3
5
2
4
1
3
1
3
1
3
2
3
2
5
4
7
1
4
2
5
1
4
2
5
2
5
1
4
1
4
1
4
2
5
2
5
1
4
2
5
1
4
1
4
4
1
4
4
7
2
5
1
4
1
4
2
3
5
3
6
1
4
5
2
5
3
6
3
6
4
7
1
4
3
6
3
6
1
4
2
5
4
1
4
1
4
1
4
3
6
1
4
1
4
1
4
3
6
1
4
1
4
1
4
2
5
5
3
6
1
4
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 1228 queries.

Test #44:

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

input:

200
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
199
155

output:

? 00000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 89 queries.

Test #45:

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

input:

200
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 403 queries.

Test #46:

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

input:

200
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
22
23
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
11
12
1
2
1
2
1
2
8
9
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
16
17
1
2
15
16
12
13
1
2
1
2
1
2
1
2
1
2
1
2
14
15
1
1
1
2
2
1
2
1
2
1
2
1
2
1
2
12
1
2
1
2
1...

output:

? 00000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000...

result:

ok Correct answer with 773 queries.

Test #47:

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

input:

200
1
1
2
1
2
1
2
13
14
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
1
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
1
2
2
1
2
1
1
1
2
1
2
2
1
2
1
2
1
1
1
2
1
2
2
16
17
1
2
1
2
1
2
1
2
1
2
1
2
2
1
2
2
1
2
2
1
2
1
2
1
2
1
2
17
17
1
18
16
33
1
18
16
17
1
16
17
17
1
17
1
17
1...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 570 queries.

Test #48:

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

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
1
3
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
2
2
4
2
4
4
2
4
2
4
1
3
4
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 3133 queries.

Test #49:

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

input:

200
2
2
4
2
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
3
5
5
2
5
2
5
2
5
2
5
2
5
5
2
5
5
2
5
2
5
5
2
5
2
5
5
2
2
4
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
2
4
4
2
4
2
...

output:

? 00000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000...

result:

ok Correct answer with 3500 queries.

Test #50:

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

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
1
3
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
2
2
4
2
4
2
4
2
4
2
4
2
4
4
2
4
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
2
4
2
4
4
2
4
4
1
3
4
2
4
2
4
2
4
2
4
4
2
4
4
2
4
2
4
4
2
4
4
2
4
4
2
4
...

output:

? 00000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 3028 queries.

Test #51:

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

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
3
5
2
5
5
2
5
2
5
2
5
2
5
5
2
5
2
5
2
5
2
5
2
5
2
5
2
5
2
5
2
5
2
5
5
2
5
5
2
5
5
2
4
1
5
2
6
6
6
2
4
2
6
2
6
2
6
5
2
6
6
6
6
6
2
6
6
2
6
2
...

output:

? 00000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
? 00000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 3500 queries.

Test #52:

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

input:

200
2
2
4
2
4
2
4
1
3
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
3
2
5
2
5
2
5
2
5
5
2
5
2
5
5
2
5
2
5
2
5
5
2
5
2
5
5
2
4
6
2
6
2
6
2
6
2
6
6
2
6
2
6
2
6
2
6
2
6
2
6
2
6
2
6
2
6
6
2
6
2
4
2
6
6
2
6
2
6
2
6
2
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok Correct answer with 3500 queries.

Test #53:

score: -100
Wrong Answer
time: 9ms
memory: 4656kb

input:

200
2
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
4
2
3
2
5
5
2
5
2
5
2
5
2
5
2
5
5
2
5
2
5
5
2
5
5
5
2
5
2
5
2
5
2
5
5
2
5
2
5
5
2
5
2
5
2
5
2
5
5
2
5
5
2
5
...

output:

? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000
? 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

wrong answer Wrong answer.