QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#164026#7119. Longest Tripnitrousoxide#5 43ms4176kbC++144.3kb2023-09-04 18:24:512024-04-28 08:31:43

Judging History

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

  • [2024-04-28 08:31:43]
  • 管理员手动重测本题所有提交记录
  • 测评结果:5
  • 用时:43ms
  • 内存:4176kb
  • [2023-09-04 18:24:52]
  • 评测
  • 测评结果:5
  • 用时:65ms
  • 内存:4148kb
  • [2023-09-04 18:24:51]
  • 提交

answer

#include "longesttrip.h"

#include <cstring>
#include <cassert>
#include <algorithm>

using namespace std;

const int maxn = 300;

int col[maxn];
bool vis[maxn];
int p[maxn];
vector<int> t[maxn];
int n;
int component_size = 0;
int components = 0;

int find_a_nonvis_edge(int u){
    vector<int> candidates;
    for (int i = 0;i < n;i++){
        if (!vis[i]){
            candidates.push_back(i);
        }
    }
    if (candidates.size() == 0){
        return -1;
    }
    if (!are_connected(candidates, vector<int>(1,u))){
        return -1;
    }
    else{
        // half the size of candidates by 2 each time
        while ((int)candidates.size() > 1){
            vector<int> first_half;
            for (int i = 0;i < candidates.size() / 2;i++){
              first_half.push_back(candidates[i]);
            }
            if (are_connected(first_half, vector<int>(1,u))){
                candidates = first_half;
            }
            else{
                vector<int> t;
                for (int i = candidates.size()/2;i < candidates.size();i++){
                  t.push_back(candidates[i]);
                }
                candidates = t;
            }
        }
        return candidates[0];
    }
}

void dfs(int u){
    vis[u] = true;
    col[u] = components;
    ++component_size;
    int i;
    while ((i = find_a_nonvis_edge(u)) != -1){
            p[i] = u;
            t[u].push_back(i);
            t[i].push_back(u);
            dfs(i);
    }
}

vector<int> path;

void find_path(int u){
    vis[u] = true;
    path.push_back(u);
    for (auto v : t[u]){
        if (!vis[v]){
            find_path(v);
            return;
        }
    }
}

void dfs2(int u){
    vis[u] = true;
    for (auto v : t[u]){
        if (!vis[v]){
            p[v] = u;
            dfs2(v);
        }
    }
}

std::vector<int> longest_trip(int N, int D)
{
    n = N;
    for (int i = 0;i < n;i++){
        t[i].clear();
        col[i] = -1;
    }
    memset(vis,false,sizeof vis);
    int max_size = -1;
    int max_id = 0;
    components = 0;

    for (int i = 0;i < n;i++){
        if (!vis[i]){
            component_size = 0;
            ++components;
            dfs(i);
            if (component_size > max_size){
                max_size = component_size;
                max_id = i;
            }
        }
    }
    // Find dfs tree from vertex max_id
    memset(vis,false,sizeof vis);

    int max_deg = 0;
    for (int i = 0;i < n;i++){
        if (vis[i]) max_deg = max(max_deg, (int)t[i].size());
    }
    assert(max_deg <= 3);
    path.clear();

    if (max_deg <= 2){
        // Starting from a deg one vertex then go from there
        memset(vis,false,sizeof vis);
        for (int i = 0;i < n;i++){
            if (t[i].size() == 1 && col[i] == col[max_id]){
                find_path(i);
                return path;
            }
        }
    }
    else{
        // The vertex with max degree 3 shall be unique, and there must be 3 deg 1 vertices
        int root = 0;
        for (int i = 0;i < n;i++){
            if (t[i].size() == 3 && col[i] == col[max_id]){
                assert(root == 0);
                root = i;
            }
        }
        assert(root != 0);
        memset(vis,false,sizeof vis);
        dfs2(root);

        int deg_1[4];
        int count_1 = 0;
        for (int i = 0;i < n;i++){
            if (t[i].size() == 1 && col[i] == col[max_id]){
                deg_1[++count_1] = i;
            }
        }
        assert(count_1 == 3);

        for (int i = 1;i <= 3;i++){
            for (int j = i+1;j <= 3;j++){
                if (are_connected(vector<int>(1,deg_1[i]), vector<int>(1,deg_1[j]))){
                    memset(vis,false,sizeof vis);
                    find_path(deg_1[6-i-j]);
                    for (int k = 1;k <= 3;k++){
                        if (!vis[deg_1[k]]){
                            int cur = deg_1[k];
                            while (cur != root){
                                path.push_back(cur);
                                cur = p[cur];
                            }
                            return path;
                        }
                    }
                }
            }
        }
    }
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 4ms
memory: 3812kb

input:

341
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
1
1
3 3
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #2:

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

input:

103
10 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 3
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #3:

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

input:

22
50 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #4:

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

input:

8
128 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 127 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #5:

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

input:

4
256 3
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Subtask #2:

score: 0
Wrong Answer

Test #6:

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

input:

341
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #7:

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

input:

103
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #8:

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

input:

22
50 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #9:

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

input:

8
128 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 127 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #10:

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

input:

4
256 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #11:

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

input:

341
3 2
1
1
0
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
1
0
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
0
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
1
0
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
1
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
0
1
1
3 2
1
1
1
1
3 2
1
1
0
1
1
3 2
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #12:

score: -10
Wrong Answer
time: 4ms
memory: 3780kb

input:

103
10 2
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 2
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
10 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 1 3 4 5 6 7 8 9 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 3 4 5 ...

result:

wrong answer 

Subtask #3:

score: 0
Wrong Answer

Test #19:

score: 25
Accepted
time: 3ms
memory: 3808kb

input:

341
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #20:

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

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #21:

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

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #22:

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

input:

8
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 127 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #23:

score: 0
Accepted
time: 30ms
memory: 4156kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #24:

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

input:

341
3 1
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #25:

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

input:

103
10 1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 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
10 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 1 3 4 5 6 7 8 9 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 3 4 5 ...

result:

ok 

Test #26:

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

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #27:

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

input:

11
101 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 100 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #28:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #29:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #30:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #31:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #32:

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

input:

341
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
0
1
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
0
1
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
0
1
1
3 1
1
1
0
0
1
3 1
0
1
1
3 1
0
1
1
3 1
0
1
1
3 1
0
1
1
3 1
1
0
0
0
1
3 1
0
1
1
3 1
1
0
0
0
1
3 1
1
0
0
0
1
3 1
0
1
1
3 1
1
1
0
0
1
3 1
1
0
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1...

result:

ok 

Test #33:

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

input:

205
5 1
1
1
0
1
0
0
0
0
0
1
1
5 1
1
1
1
1
0
1
0
0
0
1
1
5 1
1
1
1
1
1
0
0
0
1
1
5 1
1
0
1
0
0
1
1
1
1
5 1
1
0
1
0
0
1
1
1
1
5 1
1
0
1
1
0
0
0
0
0
1
1
5 1
1
1
1
0
0
1
1
1
1
5 1
1
1
1
1
0
0
0
0
0
1
1
5 1
1
1
1
1
0
0
0
0
0
1
1
5 1
1
0
1
0
0
1
1
1
1
5 1
1
1
1
1
0
1
0
0
0
1
1
5 1
1
0
1
0
0
1
1
1
1
5 1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 3 4 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 2
3kC2Ia2048BfyJVGojMUKKtilctlZK...

result:

ok 

Test #34:

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

input:

64
16 1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
0
1
0
1
1
16 1
1
1
1
0
0
1
1
1
0
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
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
16 1
1
1
1
0
0
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
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 15 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 7 1 1 2 3 4 5 6 7 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 14 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1
3...

result:

ok 

Test #35:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 31 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 15 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 7 1 1 2 3 4 5 6 7 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 ...

result:

ok 

Test #36:

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

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
0
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #37:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 99 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

result:

ok 

Test #38:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 99 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

result:

ok 

Test #39:

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

input:

4
256 1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #40:

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

input:

4
256 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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #41:

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

input:

4
256 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
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #42:

score: 0
Accepted
time: 43ms
memory: 4156kb

input:

4
256 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
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
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
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #43:

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

input:

256
4 1
0
1
1
1
1
4 1
1
1
1
1
0
0
0
1
4 1
1
0
1
1
0
0
0
0
1
4 1
1
1
1
1
0
0
0
1
4 1
0
1
1
1
1
4 1
1
0
1
1
0
0
0
0
1
4 1
1
1
1
1
0
0
0
1
4 1
0
1
1
1
1
4 1
1
1
1
0
0
0
0
1
4 1
1
0
1
1
0
0
0
0
1
4 1
1
0
1
1
0
0
0
0
1
4 1
1
0
1
1
0
0
0
0
1
4 1
1
1
1
0
0
0
0
1
4 1
1
1
1
0
0
0
0
1
4 1
1
1
1
1
0
0
0
1
4 1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 2 3 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 1 2 3
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB...

result:

ok 

Test #44:

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

input:

256
4 1
1
1
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
0
1
0
0
1
1
4 1
1
0
1
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
0
1
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
1
0
0
1
1
4 1
1
0
1
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
0
1
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
0
0
0
0
1
1
4 1
1
1
0
0
1
1
4 1
1
1
0
0
1
1
4 1
1
1
0
0
1
1
4 1
1
1
0
0
1
1
4 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 2 3 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 2 0 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3...

result:

ok 

Test #45:

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

input:

103
10 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
0
0
0
0
0
0
0
0
0
0
1
10 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
0
0
0
0
0
0
0
0
0
0
1
10 1
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
0
0
0
0
0
1
10 1
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
0
0
0
0
0
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #46:

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

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #47:

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

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
0
0
0
0
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
0
0
0
0
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #48:

score: 0
Accepted
time: 7ms
memory: 4096kb

input:

16
64 1
1
1
1
1
1
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
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 63 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 31 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...

result:

ok 

Test #49:

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

input:

16
64 1
1
1
1
1
1
1
1
1
1
1
1
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
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
1
0
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 63 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 31 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...

result:

ok 

Test #50:

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

input:

16
64 1
1
1
1
1
1
0
1
1
1
1
1
1
0
1
1
1
1
1
1
0
0
1
1
1
1
0
1
1
1
1
1
0
0
1
0
1
1
1
0
0
1
0
1
1
1
0
0
1
0
1
1
1
0
0
1
0
1
1
1
0
0
0
0
1
1
1
0
0
0
0
1
1
1
0
0
0
0
1
1
1
0
0
0
0
1
1
0
1
1
0
0
1
1
0
1
1
0
0
1
1
0
1
0
1
1
1
0
1
0
1
1
1
0
1
0
0
0
1
1
0
0
1
1
1
1
0
0
1
0
1
1
1
0
0
1
0
1
1
1
0
0
0
1
1
1
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 63 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 31 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16...

result:

ok 

Test #51:

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

input:

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

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 99 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

result:

ok 

Test #52:

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

input:

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

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 99 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

result:

ok 

Test #53:

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

input:

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

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 99 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90...

result:

ok 

Test #54:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #55:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #56:

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

input:

4
256 1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
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
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
0
1
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
1
0
1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #57:

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

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #58:

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

input:

4
256 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
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
0
0
1
1
1
1
1
1
0
0
0
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
0
1
1
1
1
1
1
1
1
0
1
0
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #59:

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

input:

4
256 1
1
1
1
1
1
1
1
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
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
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
0
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
0
1
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #60:

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

input:

4
256 1
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
0
0
1
1
1
1
1
0
0
0
0
1
1
1
1
1
0
0
0
0
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
1
0
0
1
1
1
1
0
1
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #61:

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

input:

4
256 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
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
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
0
1
1
1
1
1
1
1
1
0
1
0
0
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #62:

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

input:

4
256 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
0
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
0
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
1
0
0
1
1
1
1
1
1
0
1
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
1
1
1
1
1
1
0
1
0
0
1
1
1
1
1
0
1
0
0
1
1
1
1
1
0
1
0
0
1
1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

ok 

Test #63:

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

input:

256
4 1
1
1
1
1
0
0
1
1
4 1
1
0
1
1
1
1
1
4 1
1
0
1
1
1
1
1
4 1
1
0
1
1
1
0
1
1
4 1
1
0
1
1
0
1
1
4 1
1
0
0
1
1
1
1
4 1
1
1
1
1
0
1
1
4 1
1
1
0
1
1
1
1
4 1
1
1
1
1
0
1
1
4 1
1
1
1
1
1
1
4 1
1
0
1
1
1
1
1
4 1
1
0
1
1
0
1
1
4 1
1
1
1
0
0
0
1
1
4 1
1
0
1
1
1
0
1
1
4 1
1
1
1
1
0
1
1
4 1
1
0
0
1
1
1
1
4 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 2 3 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1...

result:

ok 

Test #64:

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

input:

256
4 1
1
0
1
1
1
1
1
4 1
1
0
0
1
0
1
1
4 1
1
0
0
1
0
1
1
4 1
1
1
1
1
0
0
1
1
4 1
1
1
1
0
0
0
1
1
4 1
1
0
1
1
0
1
1
4 1
1
0
1
1
1
1
1
4 1
1
0
1
0
1
0
1
1
4 1
1
1
1
0
0
0
1
1
4 1
1
1
1
1
1
1
4 1
1
1
0
1
0
1
1
4 1
1
0
1
1
1
0
0
1
1
4 1
1
1
1
1
0
0
1
1
4 1
1
0
1
1
1
0
0
1
1
4 1
1
1
1
1
1
1
4 1
1
0
1
0
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 3 1 1 2 3 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 3 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 3 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 4...

result:

ok 

Test #65:

score: -25
Wrong Answer
time: 0ms
memory: 3808kb

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 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
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 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
10 1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
0
1
1
1
0
1
1
0
1
0
1
1
0
1
1
10 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

wrong answer 

Subtask #4:

score: 0
Wrong Answer

Test #83:

score: 60
Accepted
time: 4ms
memory: 3824kb

input:

341
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 0 1 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #84:

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

input:

103
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 2 3 4 5 6 7 8 9 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 2 3 4 5 ...

result:

ok 

Test #85:

score: 60
Accepted
time: 19ms
memory: 3756kb

input:

22
50 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 49 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 24 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 0
3kC2Ia2048BfyJV...

result:

ok 

Test #86:

score: 30
Acceptable Answer
time: 10ms
memory: 3832kb

input:

8
128 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 127 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

points 0.50 points  0.50

Test #87:

score: 30
Acceptable Answer
time: 24ms
memory: 3872kb

input:

4
256 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
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:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 255 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 9...

result:

points 0.50 points  0.50

Test #88:

score: 60
Accepted
time: 5ms
memory: 3812kb

input:

341
3 1
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
0
1
1
3 1
1
1
1
1
3 1
1
1
0
1
1
3 1
1
0
1
1
...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 1
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
1 3 1 0 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1...

result:

ok 

Test #89:

score: 0
Wrong Answer
time: 4ms
memory: 3864kb

input:

103
10 1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
0
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
0
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
10 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
10 ...

output:

3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 9 1 1 2 3 4 5 6 7 8 9 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 2 3 4 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 2 1 1 2 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 1 1 1 0
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 8 1 1 3 4 5 6 7 8 9 2
3kC2Ia2048BfyJVGojMUKKtilctlZKcB
0 4 1 1 3 4 5 ...

result:

wrong answer