QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#326906#503. IP over Avian Carrierbachbeo2007100 ✓2ms3856kbC++203.0kb2024-02-14 13:50:542024-02-14 13:50:56

Judging History

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

  • [2024-02-14 13:50:56]
  • 评测
  • 测评结果:100
  • 用时:2ms
  • 内存:3856kb
  • [2024-02-14 13:50:54]
  • 提交

Program

#include <bits/stdc++.h>
#include "avian.h"
using namespace std;
const int maxn = 1005;

bitset<maxn> change(string s){
    bitset<maxn> res;
    for(int i=0;i<(int)s.length();i++) res[i]=s[i]-'0';
    return res;
}
vector<string> f(int N,vector<bitset<maxn>> X){
    vector<string> res((int)X.size());
    for(int i=0;i<(int)X.size();i++){
        for(int j=0;j<N;j++) res[i]+=char(X[i][j]+'0');
        //cout << res[i] << endl;
    }
    return res;
}
bitset<maxn> g(int N,bitset<maxn> a,bitset<maxn> b){
    bitset<maxn> res;
    for(int i=0;i<N;i++) res[i]=a[i]^b[i]^((i&1)?b[(i+1)%N]:a[(i+1)%N]);
    return res;
}

vector<string> encode(int C, int K, int N, string X) {
    bitset<maxn> a,b,c;
    a=change(X.substr(0,N));
    b=change(X.substr(N,N));
    if(C==3) c=change(X.substr(2*N,N));

    if(C==3 && K==4) return f(N,{a,b,c,a^b^c});
    else if(C==2 && K==4) return f(N,{a,b,a^b,g(N,a,b)});
    else return f(N,{a^c,b^c,a^b^c,g(N,a,b),c});
}
vector<bitset<maxn>> h(int N,vector<bitset<maxn>> Y,vector<bool> c){
    if(c[3]){
        if(c[0]){
            for(int i=0;i<N;i+=2) Y[1][i]=Y[3][i]^Y[0][i]^Y[0][(i+1)%N];
            for(int i=1;i<N;i+=2) Y[1][i]=Y[3][i]^Y[0][i]^Y[1][(i+1)%N];
        }
        else if(c[1]){
            for(int i=1;i<N;i+=2) Y[0][i]=Y[3][i]^Y[1][i]^Y[1][(i+1)%N];
            for(int i=0;i<N;i+=2) Y[0][i]=Y[3][i]^Y[1][i]^Y[0][(i+1)%N];
        }
        else{
            for(int i=0;i<N;i++) Y[i&1][(i+1)%N]=Y[3][i]^Y[2][i];
            for(int i=0;i<N;i++) Y[(i&1)^1][(i+1)%N]=Y[2][(i+1)%N]^Y[i&1][(i+1)%N];
        }
    }
    else if(c[2]){
        if(c[0]) Y[1]=Y[2]^Y[0];
        else Y[0]=Y[2]^Y[1];
    }
    return {Y[0],Y[1]};
}

string decode(int C, int K, int N, vector<string> Y2, vector<int> I) {
    vector<bitset<maxn>> X(C),Y(K);
    vector<bool> c(K,false);
    for(int i=0;i<C;i++){
        Y[I[i]]=change(Y2[i]);
        c[I[i]]=true;
    }

    if(C==3 && K==4){
        int pos=0;
        bitset<maxn> cur;
        for(int i=0;i<K;i++){
            if(c[i]) pos^=i,cur^=Y[i];
        }
        for(int i=0;i<K;i++){
            if(c[i] && i<=2) X[i]=Y[i];
            else if(pos<=2) X[pos]=cur;
        }
        //cout << pos << endl;
    }
    else if(C==2 && K==4) X=h(N,Y,c);
    else{
        if(c[4]){
            bitset<maxn> cur=Y[4];
            Y.pop_back();c.pop_back();
            for(int i=0;i<K-1;i++) if(c[i] && i<=2) Y[i]^=cur;
            X=h(N,Y,c);X.push_back(cur);
        }
        else if(c[3]){
            if(c[0] && c[1]) Y[2]=Y[0]^Y[1];
            else if(c[0] && c[2]) Y[1]=Y[2]^Y[0];
            else Y[0]=Y[1]^Y[2];
            for(int i=0;i<3;i++) c[i]=!c[i];
            X=h(N,Y,c);
            if(!c[0]) X.push_back(Y[0]^X[0]);
            else if(!c[1]) X.push_back(Y[1]^X[1]);
        }
        else X={Y[1]^Y[2],Y[0]^Y[2],Y[0]^Y[1]^Y[2]};
    }

    vector<string> X2=f(N,X);
    string res;
    for(int i=0;i<C;i++) res+=X2[i];
	return res;
}

详细

Subtask #1:

score: 30
Accepted

Test #1:

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

input:

3 4 997 0011010101101011001011000101111100100010100100011010011101111011000100110011101111011100011101011100100000011100111011011010010111011100001101010101000101110110011000100001101111100110000101101010110111110010101100110100010011011010010110001110111001000110101010110000101010111011010010101101...

output:

001101010110101100101100010111110010001010010001101001110111101100010011001110111101110001110101110010000001110011101101101001011101110000110101010100010111011001100010000110111110011000010110101011011111001010110011010001001101101001011000111011100100011010101011000010101011101101001010110110101001...

input:

3 4 997
0 1 2 
001101010110101100101100010111110010001010010001101001110111101100010011001110111101110001110101110010000001110011101101101001011101110000110101010100010111011001100010000110111110011000010110101011011111001010110011010001001101101001011000111011100100011010101011000010101011101101001...

output:

iunty23v7itdhugh3c001101010110101100101100010111110010001010010001101001110111101100010011001110111101110001110101110010000001110011101101101001011101110000110101010100010111011001100010000110111110011000010110101011011111001010110011010001001101101001011000111011100100011010101011000010101011101101...

result:

ok 

Test #2:

score: 30
Accepted
time: 2ms
memory: 3656kb

input:

3 4 997 1111100001010101110011100111000010110010101101100000011110111011111001011000100011010100110000001000111010010111000000000010110100100100001000001101100010110110010111101111110011101011010110110110101111101000011101110110110111011001010100000011110110000000011011010111111001110100001111001011...

output:

111110000101010111001110011100001011001010110110000001111011101111100101100010001101010011000000100011101001011100000000001011010010010000100000110110001011011001011110111111001110101101011011011010111110100001110111011011011101100101010000001111011000000001101101011111100111010000111100101110011110...

input:

3 4 997
0 1 2 
111110000101010111001110011100001011001010110110000001111011101111100101100010001101010011000000100011101001011100000000001011010010010000100000110110001011011001011110111111001110101101011011011010111110100001110111011011011101100101010000001111011000000001101101011111100111010000111...

output:

iunty23v7itdhugh3c111110000101010111001110011100001011001010110110000001111011101111100101100010001101010011000000100011101001011100000000001011010010010000100000110110001011011001011110111111001110101101011011011010111110100001110111011011011101100101010000001111011000000001101101011111100111010000...

result:

ok 

Test #3:

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

input:

3 4 997 1001110110011100101110011010101011011100000000010000101101100000110000111101001101011010101111000110011101011011100000000011000001000110101101111110100110100010000110101001101011111101110111000011110001011000101010000000000001000101100100000111010110110101000100100110110100001110101110111110...

output:

100111011001110010111001101010101101110000000001000010110110000011000011110100110101101010111100011001110101101110000000001100000100011010110111111010011010001000011010100110101111110111011100001111000101100010101000000000000100010110010000011101011011010100010010011011010000111010111011111001101001...

input:

3 4 997
2 0 1 
100001100011001101101001000111001110000001000111111110110011110101011010001000010111111000000011011111111010010011101011000110101010100001100111110011101000000011100101100110100101010000101110001101101000110011100010000010110101110101111100111001001111011001100100010010011111100110010...

output:

iunty23v7itdhugh3c100111011001110010111001101010101101110000000001000010110110000011000011110100110101101010111100011001110101101110000000001100000100011010110111111010011010001000011010100110101111110111011100001111000101100010101000000000000100010110010000011101011011010100010010011011010000111010...

result:

ok 

Test #4:

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

input:

3 4 997 1101100101110111011100111100000010000000000010111101111101111011100110101011111001111101010000011110110011010110101111010010001100010111000010111100000111111101011101001110101011010000010110101111101101010110001110101100001111000101001100110000100100110010100011101000000000010011001010000111...

output:

110110010111011101110011110000001000000000001011110111110111101110011010101111100111110101000001111011001101011010111101001000110001011100001011110000011111110101110100111010101101000001011010111110110101011000111010110000111100010100110011000010010011001010001110100000000001001100101000011100010110...

input:

3 4 997
1 3 0 
011101111001001000001011110100000111010101111001101100001010100001110000010001011011010111000110001111000110111010010000101111010100001000100100110010010011011100001000100101110011001111001101011110000101100011110100100001010100111011111110011000101101100000110100100011011001100000001...

output:

iunty23v7itdhugh3c110110010111011101110011110000001000000000001011110111110111101110011010101111100111110101000001111011001101011010111101001000110001011100001011110000011111110101110100111010101101000001011010111110110101011000111010110000111100010100110011000010010011001010001110100000000001001100...

result:

ok 

Test #5:

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

input:

3 4 997 0110011010100011111110011100111101011000101001100010100001100001001000001001001100101111010111000100101001100101000010010010111111001110111001101001101010000000010000000001001000011000100010101001101101100101001010101111101000100100100010111110110010101101000001000000010101010101010000100111...

output:

011001101010001111111001110011110101100010100110001010000110000100100000100100110010111101011100010010100110010100001001001011111100111011100110100110101000000001000000000100100001100010001010100110110110010100101010111110100010010010001011111011001010110100000100000001010101010101000010011110110000...

input:

3 4 997
3 0 1 
011110110001001111110111011100101111011100010110011011011011010000011101110000011010001000111011110111011010110101100001111000101110000000010011011110001010100010011101011000001111100001101001100010110111010001001010010101000101011110110010000100001001111100011110001001101000101100001...

output:

iunty23v7itdhugh3c011001101010001111111001110011110101100010100110001010000110000100100000100100110010111101011100010010100110010100001001001011111100111011100110100110101000000001000000000100100001100010001010100110110110010100101010111110100010010010001011111011001010110100000100000001010101010101...

result:

ok 

Test #6:

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

input:

3 4 997 0110100001110010011011101101010011110000010111100111001100001110011111010110000010000000010001101111100001001011010001101011111111110001100100111000111110010111000111000111101001110100111000101011010110000000111010011011000000010111000000111111011101011101110101101001101000101001111000111100...

output:

011010000111001001101110110101001111000001011110011100110000111001111101011000001000000001000110111110000100101101000110101111111111000110010011100011111001011100011100011110100111010011100010101101011000000011101001101100000001011100000011111101110101110111010110100110100010100111100011110011101101...

input:

3 4 997
2 1 0 
000100010001101110000001111010111000101011001000110110010011010010100010111100101111111111001101110000000010001101001001001111111010111111011101111100010011111111011001001000110010110011101100010100010011011011010011111010001011111110101110011100111100100110100100010110000011111001111...

output:

iunty23v7itdhugh3c011010000111001001101110110101001111000001011110011100110000111001111101011000001000000001000110111110000100101101000110101111111111000110010011100011111001011100011100011110100111010011100010101101011000000011101001101100000001011100000011111101110101110111010110100110100010100111...

result:

ok 

Test #7:

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

input:

3 4 997 1100011010001011010001111001111011111011110001001100101101100101110011010110001001110001111000110011000111011100011100101110010001010111011111010011000000000101000100100100001100001011011010100110010011111100101100111110100100001010110000000101011111111011000011010001111110110100011111110000...

output:

110001101000101101000111100111101111101111000100110010110110010111001101011000100111000111100011001100011101110001110010111001000101011101111101001100000000010100010010010000110000101101101010011001001111110010110011111010010000101011000000010101111111101100001101000111111011010001111111000011101000...

input:

3 4 997
2 3 1 
011111001100100001011001110110110110011011010111101101111011110101001110100000101010101000000110111110110100110000000101000011111111100011100110011010011111001101010111011011000000100001101111011101111010001011100010111110010111101110101110111101011011100011000001110100101010111110000...

output:

iunty23v7itdhugh3c110001101000101101000111100111101111101111000100110010110110010111001101011000100111000111100011001100011101110001110010111001000101011101111101001100000000010100010010010000110000101101101010011001001111110010110011111010010000101011000000010101111111101100001101000111111011010001...

result:

ok 

Test #8:

score: 30
Accepted
time: 2ms
memory: 3656kb

input:

3 4 997 0110101110010011001000010000111010101011000110001011101010100110010100001100011101100111100010110000010010000100111001100001100011000000110110001000101011000111110000001000110010010010001111111110111111111010001010100110011011100011011011001011101010100110111001101100111110110011011011000100...

output:

011010111001001100100001000011101010101100011000101110101010011001010000110001110110011110001011000001001000010011100110000110001100000011011000100010101100011111000000100011001001001000111111111011111111101000101010011001101110001101101100101110101010011011100110110011111011001101101100010010111001...

input:

3 4 997
2 0 3 
010111000010000010001111010011100110010101110110000110010010110110101101011001001010010001000011010101010010111000111110001110110011011110101101111010100101101100011001101011011110101011010100010110010000010000110011111101111001100011000100101010111001010111000111101101111111101011011...

output:

iunty23v7itdhugh3c011010111001001100100001000011101010101100011000101110101010011001010000110001110110011110001011000001001000010011100110000110001100000011011000100010101100011111000000100011001001001000111111111011111111101000101010011001101110001101101100101110101010011011100110110011111011001101...

result:

ok 

Test #9:

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

input:

3 4 997 1010101010001000001101010111110011101100010111000111100010010110110101011110100010100001111000000010001110101000000100100011111100000100010111111101001111010100101110101001101000101001010100110011001001111000100000010101110010001000001101101011110110111110110111100010011111001011000001100100...

output:

101010101000100000110101011111001110110001011100011110001001011011010101111010001010000111100000001000111010100000010010001111110000010001011111110100111101010010111010100110100010100101010011001100100111100010000001010111001000100000110110101111011011111011011110001001111100101100000110010011101011...

input:

3 4 997
3 0 2 
110000100010010010101110010000101110101101111001101000111110000101000100100000000111101001011110011000001011011110110010010110011000110100001001000111110000111111100110111100110100101000100010011011111111101101101100111001001000111100001001000111000110100010101101111001101111010101101...

output:

iunty23v7itdhugh3c101010101000100000110101011111001110110001011100011110001001011011010101111010001010000111100000001000111010100000010010001111110000010001011111110100111101010010111010100110100010100101010011001100100111100010000001010111001000100000110110101111011011111011011110001001111100101100...

result:

ok 

Test #10:

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

input:

3 4 997 0001010010010000101001001110010010101001110010111001111111011101101111000001101100111110110000101000000001100001010001110111111100000110111011000011010101111001001110000100100000101001100010101110001101010001011101000011000000001010010111011101101001010000110100111110010100110111100010101101...

output:

000101001001000010100100111001001010100111001011100111111101110110111100000110110011111011000010100000000110000101000111011111110000011011101100001101010111100100111000010010000010100110001010111000110101000101110100001100000000101001011101110110100101000011010011111001010011011110001010110100101000...

input:

3 4 997
2 3 0 
100111000101111110001111011111101010110011101101110100000011011101110100011111111000000111100000000000101110110111001001000100111011001101100000101100010001110000111111001111000110000101001001100000110000100001011111011001110100111101011000100111001011101100011101010101011011110101010...

output:

iunty23v7itdhugh3c000101001001000010100100111001001010100111001011100111111101110110111100000110110011111011000010100000000110000101000111011111110000011011101100001101010111100100111000010010000010100110001010111000110101000101110100001100000000101001011101110110100101000011010011111001010011011110...

result:

ok 

Test #11:

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

input:

3 4 997 0100110100101010101000001010101110001110001000000101000011011101110110101011110010000111101011111011101000101111010011100111010100110000110101111110100101101011100111000011000111100100111010000000110101010111101111001100100100110001110001101001101010100101000100111100100111010110100100011110...

output:

010011010010101010100000101010111000111000100000010100001101110111011010101111001000011110101111101110100010111101001110011101010011000011010111111010010110101110011100001100011110010011101000000011010101011110111100110010010011000111000110100110101010010100010011110010011101011010010001111001100011...

input:

3 4 997
2 0 3 
110110010101101110111110001001001100001010001001111000100100000110000000001010000000101011101101011001001010011000110011100000001001110011010010001001001000001011111100100100001000010001101111110101101011000101111010110110111010101111101100101110101101100100100011000011100101110001000...

output:

iunty23v7itdhugh3c010011010010101010100000101010111000111000100000010100001101110111011010101111001000011110101111101110100010111101001110011101010011000011010111111010010110101110011100001100011110010011101000000011010101011110111100110010010011000111000110100110101010010100010011110010011101011010...

result:

ok 

Test #12:

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

input:

3 4 997 0001011101010010101010110110111100100111101010101001000100010100011011111001101011001110101100111111000010100010011100010110010111101011001110011101011001101111010100010010110110001111001000010011011011101100011101100110111000100001011110011001100011111110111011110010110011101000001000010000...

output:

000101110101001010101011011011110010011110101010100100010001010001101111100110101100111010110011111100001010001001110001011001011110101100111001110101100110111101010001001011011000111100100001001101101110110001110110011011100010000101111001100110001111111011101111001011001110100000100001000000101011...

input:

3 4 997
3 2 0 
101011010111111100101100100110011100001110000111110001100011100110110101001100000011001000100010011010111010100110101001110111000110001010001100000100010001111001010010001111101011001000111111010101110101101110110010110111001010001100101001101100010011100110100011000000100111011101101...

output:

iunty23v7itdhugh3c000101110101001010101011011011110010011110101010100100010001010001101111100110101100111010110011111100001010001001110001011001011110101100111001110101100110111101010001001011011000111100100001001101101110110001110110011011100010000101111001100110001111111011101111001011001110100000...

result:

ok 

Test #13:

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

input:

3 4 997 0100001101100101100011010011101001110110010001101001000010001110001011001011110111010111000000001000011010110101001011111100010111011100000000001011110010101000000110010001001110111011001011001101010001010001001111110111110100100000011000001111001111110011111100110111100101010101010010100011...

output:

010000110110010110001101001110100111011001000110100100001000111000101100101111011101011100000000100001101011010100101111110001011101110000000000101111001010100000011001000100111011101100101100110101000101000100111111011111010010000001100000111100111111001111110011011110010101010101001010001110001010...

input:

3 4 997
3 2 1 
100000101011000011101010101001101001001110011001011110011110011110001001010011011000010011001101000000110011010101010100000000111100000000110101010001111000001110100010101011110001001111010010111000111100000011011000000010100000001000100001010111010011100100111001000101101001100001001...

output:

iunty23v7itdhugh3c010000110110010110001101001110100111011001000110100100001000111000101100101111011101011100000000100001101011010100101111110001011101110000000000101111001010100000011001000100111011101100101100110101000101000100111111011111010010000001100000111100111111001111110011011110010101010101...

result:

ok 

Test #14:

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

input:

3 4 997 0011010111000101010101000111000101111000010101010100011001010110001001101010110100110110001010001001100010001110011111111000111101001000010010100101001101111001111001101100010000011101000011100010011000111110001101011011011001100111111100111101001011100010011000101010100110100111010000000000...

output:

001101011100010101010100011100010111100001010101010001100101011000100110101011010011011000101000100110001000111001111111100011110100100001001010010100110111100111100110110001000001110100001110001001100011111000110101101101100110011111110011110100101110001001100010101010011010011101000000000001011001...

input:

3 4 997
0 2 1 
001101011100010101010100011100010111100001010101010001100101011000100110101011010011011000101000100110001000111001111111100011110100100001001010010100110111100111100110110001000001110100001110001001100011111000110101101101100110011111110011110100101110001001100010101010011010011101000...

output:

iunty23v7itdhugh3c001101011100010101010100011100010111100001010101010001100101011000100110101011010011011000101000100110001000111001111111100011110100100001001010010100110111100111100110110001000001110100001110001001100011111000110101101101100110011111110011110100101110001001100010101010011010011101...

result:

ok 

Test #15:

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

input:

3 4 997 1010101011101110011011110110000110011010001001001100111100011100010100100100010100011100001111111110011011110001010100100010001100110101100100100010100110011011101100111001010000110100000011111110100011000101101111110011001110001000010010111110001110000101011101111010100101011011000011101100...

output:

101010101110111001101111011000011001101000100100110011110001110001010010010001010001110000111111111001101111000101010010001000110011010110010010001010011001101110110011100101000011010000001111111010001100010110111111001100111000100001001011111000111000010101110111101010010101101100001110110001100100...

input:

3 4 997
1 2 3 
110010000001111101011111011111011111011111011010001100100111101110010101000010100111111111011100100100010111110001011001000101100011001111100110110110110000111011010000010101111000011100111010011100001110110101011101011111010010101111101001100001001111110011101001010001110110011101101...

output:

iunty23v7itdhugh3c101010101110111001101111011000011001101000100100110011110001110001010010010001010001110000111111111001101111000101010010001000110011010110010010001010011001101110110011100101000011010000001111111010001100010110111111001100111000100001001011111000111000010101110111101010010101101100...

result:

ok 

Test #16:

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

input:

3 4 997 1000100101101000001110111001101010100001000101001110111100111101111000101110110001111011010110100010001000001010101111010111101111110101100111100011010001011111101001110001110000100101100111101010110001001000101100100000001011000010001010111000101000100110101011101011001000010101000100100101...

output:

100010010110100000111011100110101010000100010100111011110011110111100010111011000111101101011010001000100000101010111101011110111111010110011110001101000101111110100111000111000010010110011110101011000100100010110010000000101100001000101011100010100010011010101110101100100001010100010010010100111011...

input:

3 4 997
2 0 1 
100000000011010011011101110000110010110101101000100110000101001101001010000111100001010111110110011000111110000100101110111111111100000000001111110001001010111111100011110001101011010011010000111111111010111100011001010010100001101001101101100111101001101011010101110111111001101011111...

output:

iunty23v7itdhugh3c100010010110100000111011100110101010000100010100111011110011110111100010111011000111101101011010001000100000101010111101011110111111010110011110001101000101111110100111000111000010010110011110101011000100100010110010000000101100001000101011100010100010011010101110101100100001010100...

result:

ok 

Subtask #2:

score: 25
Accepted

Test #17:

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

input:

2 4 998 1000110101101001111010101101100101011111011111110001101110110001010100000011001110011111100010010001111100001111001111100100110011100000100010100101001001000001010010110010010110111000001001100110011110101010100101000010110100100110001011000100011111011010101100010001110110010110101111011011...

output:

100011010110100111101010110110010101111101111111000110111011000101010000001100111001111110001001000111110000111100111110010011001110000010001010010100100100000101001011001001011011100000100110011001111010101010010100001011010010011000101100010001111101101010110001000111011001011010111101101110000010...

input:

2 4 998
0 1 
10001101011010011110101011011001010111110111111100011011101100010101000000110011100111111000100100011111000011110011111001001100111000001000101001010010010000010100101100100101101110000010011001100111101010101001010000101101001001100010110001000111110110101011000100011101100101101011110...

output:

iunty23v7itdhugh3c100011010110100111101010110110010101111101111111000110111011000101010000001100111001111110001001000111110000111100111110010011001110000010001010010100100100000101001011001001011011100000100110011001111010101010010100001011010010011000101100010001111101101010110001000111011001011010...

result:

ok 

Test #18:

score: 25
Accepted
time: 2ms
memory: 3852kb

input:

2 4 998 0001000010111001011001110111011101101001100100000110100100111011101101111010100100100000011010001111110111111010111001011111100010000100110011001111001011011110100111010101111000010111001101010100101011101001110111110001011010001000011000010001111101100010111011100100011000100010001111011111...

output:

000100001011100101100111011101110110100110010000011010010011101110110111101010010010000001101000111111011111101011100101111110001000010011001100111100101101111010011101010111100001011100110101010010101110100111011111000101101000100001100001000111110110001011101110010001100010001000111101111110100001...

input:

2 4 998
2 1 
11111001111111011100011010100101101111110101100011011011100010110111011100110101111000100001011111111000000011110000100001011000100110011001101110011010100101100111011110011100011111000110110011111100110110000010111011001111010101100000000100001010110110110100011111000010000110110110111...

output:

iunty23v7itdhugh3c000100001011100101100111011101110110100110010000011010010011101110110111101010010010000001101000111111011111101011100101111110001000010011001100111100101101111010011101010111100001011100110101010010101110100111011111000101101000100001100001000111110110001011101110010001100010001000...

result:

ok 

Test #19:

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

input:

2 4 998 1001110011001010100001100111001111111011110101001000001100000010001000001011011001110111100001010010111100000100111111111001001011100000001101010110100111100110010000011101001111110100110111110010110011111010000010011100100100001100011111000101110110111001011100010010011010101000001100000111...

output:

100111001100101010000110011100111111101111010100100000110000001000100000101101100111011110000101001011110000010011111111100100101110000000110101011010011110011001000001110100111111010011011111001011001111101000001001110010010000110001111100010111011011100101110001001001101010100000110000011100111011...

input:

2 4 998
2 3 
11000001100101010010010001100111000000010001001111000100111110110100001111110101110101111111101101101100111000001100010110010111001101100011100011011110001010010100101011000111100000001000001000000001010001100111001011001111000110010101111110011111111111110110000010101010110011011011001...

output:

iunty23v7itdhugh3c100111001100101010000110011100111111101111010100100000110000001000100000101101100111011110000101001011110000010011111111100100101110000000110101011010011110011001000001110100111111010011011111001011001111101000001001110010010000110001111100010111011011100101110001001001101010100000...

result:

ok 

Test #20:

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

input:

2 4 998 1101000100100000000001111110000001100100010010001011011111010001100101100000111010110111110110111001100010111001101010101110110111100001100011111000001100111100001010001101100000111000111001110011101000100100010001111101001010101000010001000001101001100010110001000000101001110111001101111011...

output:

110100010010000000000111111000000110010001001000101101111101000110010110000011101011011111011011100110001011100110101010111011011110000110001111100000110011110000101000110110000011100011100111001110100010010001000111110100101010100001000100000110100110001011000100000010100111011100110111101101110101...

input:

2 4 998
0 3 
11010001001000000000011111100000011001000100100010110111110100011001011000001110101101111101101110011000101110011010101011101101111000011000111110000011001111000010100011011000001110001110011100111010001001000100011111010010101010000100010000011010011000101100010000001010011101110011011...

output:

iunty23v7itdhugh3c110100010010000000000111111000000110010001001000101101111101000110010110000011101011011111011011100110001011100110101010111011011110000110001111100000110011110000101000110110000011100011100111001110100010010001000111110100101010100001000100000110100110001011000100000010100111011100...

result:

ok 

Test #21:

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

input:

2 4 998 0111000110011000001100100101011010101111101001111001101011001100111001110100111110100101010000111010110001110000010011100110000100000101111000010111011111100011000010001110100100111101110000100100010110011111011001111000100011010101101001011001011101001111011001001010010001111000000101010100...

output:

011100011001100000110010010101101010111110100111100110101100110011100111010011111010010101000011101011000111000001001110011000010000010111100001011101111110001100001000111010010011110111000010010001011001111101100111100010001101010110100101100101110100111101100100101001000111100000010101010001000011...

input:

2 4 998
0 1 
01110001100110000011001001010110101011111010011110011010110011001110011101001111101001010100001110101100011100000100111001100001000001011110000101110111111000110000100011101001001111011100001001000101100111110110011110001000110101011010010110010111010011110110010010100100011110000001010...

output:

iunty23v7itdhugh3c011100011001100000110010010101101010111110100111100110101100110011100111010011111010010101000011101011000111000001001110011000010000010111100001011101111110001100001000111010010011110111000010010001011001111101100111100010001101010110100101100101110100111101100100101001000111100000...

result:

ok 

Test #22:

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

input:

2 4 998 1101100100011100110000110000011101110101000001000011110111010010110111101110011000100101011011101000000010001011110001111001100100001100101100011101011000110111000001100111100111111110110111011110111110100001100110100000101000110000111111100001110000000011000001001110111010110110001100001110...

output:

110110010001110011000011000001110111010100000100001111011101001011011110111001100010010101101110100000001000101111000111100110010000110010110001110101100011011100000110011110011111111011011101111011111010000110011010000010100011000011111110000111000000001100000100111011101011011000110000111011111100...

input:

2 4 998
1 2 
11011101000010011110100011101111011011100011100101010101001110111100111101011011000000011100000000110110110110011011000000111111110100110001001010110111101101000101000010000101111001001101101111001110011001000111101101111000001110001001001111100000100000101101101101111110101001111001011...

output:

iunty23v7itdhugh3c110110010001110011000011000001110111010100000100001111011101001011011110111001100010010101101110100000001000101111000111100110010000110010110001110101100011011100000110011110011111111011011101111011111010000110011010000010100011000011111110000111000000001100000100111011101011011000...

result:

ok 

Test #23:

score: 25
Accepted
time: 2ms
memory: 3624kb

input:

2 4 998 0101001010011000010001001000011111001110110001101010100100110101110101011011110000100111101100111000001000101101101111101110011110110010110010111110010000011111010110110010010001111011100011001100110101000001110111100000011111001111000111100001111110011110100001110110010011100011110010101100...

output:

010100101001100001000100100001111100111011000110101010010011010111010101101111000010011110110011100000100010110110111110111001111011001011001011111001000001111101011011001001000111101110001100110011010100000111011110000001111100111100011110000111111001111010000111011001001110001111001010110000101111...

input:

2 4 998
1 3 
10100011011010111011011100100100000100101100111010111110111111101001100000001010111100100110001011001010010100000101111011100010010000101101110010101000011000101011110100000110011001111100000010101111000101001100001000100100001100000111111001010001111000011101101000011111111000110010111...

output:

iunty23v7itdhugh3c010100101001100001000100100001111100111011000110101010010011010111010101101111000010011110110011100000100010110110111110111001111011001011001011111001000001111101011011001001000111101110001100110011010100000111011110000001111100111100011110000111111001111010000111011001001110001111...

result:

ok 

Test #24:

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

input:

2 4 998 0010110000000110101011100110110010100111000100000111101100101110010101001010111101111011100111111110011101001101000111011111111001011010001011001111111110100001100110010010010111010111111001000011011101100100000011000000010001111100000110011011000010110100010101011100010110010000011101111101...

output:

001011000000011010101110011011001010011100010000011110110010111001010100101011110111101110011111111001110100110100011101111111100101101000101100111111111010000110011001001001011101011111100100001101110110010000001100000001000111110000011001101100001011010001010101110001011001000001110111110100010001...

input:

2 4 998
0 3 
00101100000001101010111001101100101001110001000001111011001011100101010010101111011110111001111111100111010011010001110111111110010110100010110011111111101000011001100100100101110101111110010000110111011001000000110000000100011111000001100110110000101101000101010111000101100100000111011...

output:

iunty23v7itdhugh3c001011000000011010101110011011001010011100010000011110110010111001010100101011110111101110011111111001110100110100011101111111100101101000101100111111111010000110011001001001011101011111100100001101110110010000001100000001000111110000011001101100001011010001010101110001011001000001...

result:

ok 

Test #25:

score: 25
Accepted
time: 2ms
memory: 3852kb

input:

2 4 998 0100011010100000100111100110001011001011101010111110110110110111010110001110001111110010111011000010000110110111010000111011000000110111000100010100101110000101101101111111111100010010001010111101110111011010101110010000101110100111111001110001000000000000011101100010010010011100000011100011...

output:

010001101010000010011110011000101100101110101011111011011011011101011000111000111111001011101100001000011011011101000011101100000011011100010001010010111000010110110111111111110001001000101011110111011101101010111001000010111010011111100111000100000000000001110110001001001001110000001110001111111100...

input:

2 4 998
1 2 
11100010000110011001010000000011010000101001100011001010001110011011011101010101110110111000110001010111100011000100011110110110010101111111111010011010011011000111101001100101011100101101011100011111101001010110001000010011001100001001111100011000110001000100110101011011010110110111001...

output:

iunty23v7itdhugh3c010001101010000010011110011000101100101110101011111011011011011101011000111000111111001011101100001000011011011101000011101100000011011100010001010010111000010110110111111111110001001000101011110111011101101010111001000010111010011111100111000100000000000001110110001001001001110000...

result:

ok 

Test #26:

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

input:

2 4 998 1001010100111000100101111111100000011000100110000001110001011111101111001110101000010110000100010111000101011000011100101110000001110010001100000011000110011011101001011000100001101110101111010101000111000001010110101011011100011010100101100001011001110100111110110101111011101011011110011100...

output:

100101010011100010010111111110000001100010011000000111000101111110111100111010100001011000010001011100010101100001110010111000000111001000110000001100011001101110100101100010000110111010111101010100011100000101011010101101110001101010010110000101100111010011111011010111101110101101111001110000010011...

input:

2 4 998
1 0 
00100100010000010100001110010010010110111111000101001001100101101111100001111110010111010001100100000000011111010011010001010011100010101001111001001110001110101100001101001110110111111110000000110100001100000000000111000000101010010000011101110011101011000100101111000001000100010111000...

output:

iunty23v7itdhugh3c100101010011100010010111111110000001100010011000000111000101111110111100111010100001011000010001011100010101100001110010111000000111001000110000001100011001101110100101100010000110111010111101010100011100000101011010101101110001101010010110000101100111010011111011010111101110101101...

result:

ok 

Test #27:

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

input:

2 4 998 0011001101010001110111010101011111110011001100000000010101010110101100010110000110101101011111010100001001001000101100010001010111111111100000011011110101101101110100110101011000001010011100000111011001010001101011010101001100011000001011010111110111000001100111110000000010100000011111110101...

output:

001100110101000111011101010101111111001100110000000001010101011010110001011000011010110101111101010000100100100010110001000101011111111110000001101111010110110111010011010101100000101001110000011101100101000110101101010100110001100000101101011111011100000110011111000000001010000001111111010101110101...

input:

2 4 998
1 2 
01110011111001100111110011110110110111111001010000010101101001110001000001100110000111110100101001000100111101100110101101111001001010011011011110111011111100101100100111111100000100010110000000100010110100111001111111001100010100011110110001010111001110010001100101001100101011110001110...

output:

iunty23v7itdhugh3c001100110101000111011101010101111111001100110000000001010101011010110001011000011010110101111101010000100100100010110001000101011111111110000001101111010110110111010011010101100000101001110000011101100101000110101101010100110001100000101101011111011100000110011111000000001010000001...

result:

ok 

Test #28:

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

input:

2 4 998 1110010011101001101110001110111110010111000100010010100100110000000011101000010001100111001101110001010011001100110011000000010111001011000010100001110110111110100100111100000100111111010011001101010101111001110000111101111110100111000111000011100001011110111010001111111010110001000101100011...

output:

111001001110100110111000111011111001011100010001001010010011000000001110100001000110011100110111000101001100110011001100000001011100101100001010000111011011111010010011110000010011111101001100110101010111100111000011110111111010011100011100001110000101111011101000111111101011000100010110001111111100...

input:

2 4 998
3 2 
00111001000010011111001111000010010001000011010000010001010110011111011110010110011011101111001101000110100101110011001101000000001111101001110001010101101001000111101100100011111110000111100001110011001000001010101010101111010010000101010000101010111110100110101100111111010100101000010...

output:

iunty23v7itdhugh3c111001001110100110111000111011111001011100010001001010010011000000001110100001000110011100110111000101001100110011001100000001011100101100001010000111011011111010010011110000010011111101001100110101010111100111000011110111111010011100011100001110000101111011101000111111101011000100...

result:

ok 

Test #29:

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

input:

2 4 998 1011100001101001110011011001100111100001100010110111001101110001100000001101110110011111110111101000111110110010101010111000110100010010101000111001001110011100111110111001110001100001101011100110001010101101011111110111101000010110010110100000101111010011101101001001010001101010001000100000...

output:

101110000110100111001101100110011110000110001011011100110111000110000000110111011001111111011110100011111011001010101011100011010001001010100011100100111001110011111011100111000110000110101110011000101010110101111111011110100001011001011010000010111101001110110100100101000110101000100010000010111110...

input:

2 4 998
3 1 
10011011110000001011011100100101000110000100101010100110101010001110110101010100100010100111010010111011110001000111111010111100001010001001101010010111000101100010010101110111011100101000111100010011111110100100011100100001011010110100111001110010100111101101011000001001101111100111000...

output:

iunty23v7itdhugh3c101110000110100111001101100110011110000110001011011100110111000110000000110111011001111111011110100011111011001010101011100011010001001010100011100100111001110011111011100111000110000110101110011000101010110101111111011110100001011001011010000010111101001110110100100101000110101000...

result:

ok 

Test #30:

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

input:

2 4 998 1010111110110101110011101100001110101101111011001110011111011101010011000110101101000010110011110111011000011000110011011010111010010010111011001101001000000000001100001111010011000011101011001100100011111100001010101000101110010000101101100001100101101111010111011010111101111101000100010011...

output:

101011111011010111001110110000111010110111101100111001111101110101001100011010110100001011001111011101100001100011001101101011101001001011101100110100100000000000110000111101001100001110101100110010001111110000101010100010111001000010110110000110010110111101011101101011110111110100010001001100011011...

input:

2 4 998
2 0 
00110011110010001010000010000100000010001001111010101100011101001111110100011000011101101110010001111101100011000110011000100011011000111100111000111010100110011011011110101001000000011110011111010001010101110110101011001010000011111011110100111111110100010101010000110001000010100110100...

output:

iunty23v7itdhugh3c101011111011010111001110110000111010110111101100111001111101110101001100011010110100001011001111011101100001100011001101101011101001001011101100110100100000000000110000111101001100001110101100110010001111110000101010100010111001000010110110000110010110111101011101101011110111110100...

result:

ok 

Test #31:

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

input:

2 4 998 1111011100000111001010011011100111000110101010110011100010001011100000000111100111010100111101110010111010101000011010110100110110111111011100010111010010111111011110010111100000101001001010110101100010011010101111001100101101100110101010100110110011100110110011011000101011010101001111000111...

output:

111101110000011100101001101110011100011010101011001110001000101110000000011110011101010011110111001011101010100001101011010011011011111101110001011101001011111101111001011110000010100100101011010110001001101010111100110010110110011010101010011011001110011011001101100010101101010100111100011110000001...

input:

2 4 998
1 2 
10010101011000011010001001100011101010001100010101101100111110011111010100010001001001101011001101100001000000101011000110010001010001100011111011011010111110010101100101010011101110100010010110100101010000011100001001011001101110011001110010100011100100010001010011011010001110101100001...

output:

iunty23v7itdhugh3c111101110000011100101001101110011100011010101011001110001000101110000000011110011101010011110111001011101010100001101011010011011011111101110001011101001011111101111001011110000010100100101011010110001001101010111100110010110110011010101010011011001110011011001101100010101101010100...

result:

ok 

Test #32:

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

input:

2 4 998 0101111101110111010110101011011001101001100011010100101010001000110101100000001100111100000001111100100010110101101101101010100101000101101010110111010010100101111101011010101110000111111000011110101100110101001010011011000010100111111111000110011000010110101000010011101100010000001111000111...

output:

010111110111011101011010101101100110100110001101010010101000100011010110000000110011110000000111110010001011010110110110101010010100010110101011011101001010010111110101101010111000011111100001111010110011010100101001101100001010011111111100011001100001011010100001001110110001000000111100011100011000...

input:

2 4 998
0 3 
01011111011101110101101010110110011010011000110101001010100010001101011000000011001111000000011111001000101101011011011010101001010001011010101101110100101001011111010110101011100001111110000111101011001101010010100110110000101001111111110001100110000101101010000100111011000100000011110...

output:

iunty23v7itdhugh3c010111110111011101011010101101100110100110001101010010101000100011010110000000110011110000000111110010001011010110110110101010010100010110101011011101001010010111110101101010111000011111100001111010110011010100101001101100001010011111111100011001100001011010100001001110110001000000...

result:

ok 

Subtask #3:

score: 20
Accepted

Test #33:

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

input:

2 4 997 1000111101100000111001101001001101111101000100111100010101001010000011001110101111010111111001111000010001111010001011111101101010100011101100001000000000100110000000011110101111100000111000011000011000111110011101000000011000110001001111000100110101001101111000101000101001001010001101011000...

output:

100011110110000011100110100100110111110100010011110001010100101000001100111010111101011111100111100001000111101000101111110110101010001110110000100000000010011000000001111010111110000011100001100001100011111001110100000001100011000100111100010011010100110111100010100010100100101000110101100010100110...

input:

2 4 997
3 0 
01011000011000100010111010101001110111111111100110010000101001111100101000001111110100100000101011100100010011101100110011110101110111001100110100000101101011001011101100111010010011100110010010011111111111011010011010100101100100000011001011001100100001001110110101010100000000000001110...

output:

iunty23v7itdhugh3c100011110110000011100110100100110111110100010011110001010100101000001100111010111101011111100111100001000111101000101111110110101010001110110000100000000010011000000001111010111110000011100001100001100011111001110100000001100011000100111100010011010100110111100010100010100100101000...

result:

ok 

Test #34:

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

input:

2 4 997 0111011000100010100011000000000111011100111011000010100011000100101011001110011111110100100101011111001001011011011001001100111101010101000001110011010101100101111000001001101010000100110011100001101001111011000101001110001001010000100111011011001010010011101001010101011100011110011000111101...

output:

011101100010001010001100000000011101110011101100001010001100010010101100111001111111010010010101111100100101101101100100110011110101010100000111001101010110010111100000100110101000010011001110000110100111101100010100111000100101000010011101101100101001001110100101010101110001111001100011110101000000...

input:

2 4 997
3 2 
01111100001010111011011010000110011110110000011110010100000011011101000000111000100101001000010011101101011011101000010110110100001111011011111001110000110001101000010001101010001110100010010010000010111000010011010001011011100111010110010011111111111001101110000011011011000111000100111...

output:

iunty23v7itdhugh3c011101100010001010001100000000011101110011101100001010001100010010101100111001111111010010010101111100100101101101100100110011110101010100000111001101010110010111100000100110101000010011001110000110100111101100010100111000100101000010011101101100101001001110100101010101110001111001...

result:

ok 

Test #35:

score: 20
Accepted
time: 2ms
memory: 3608kb

input:

2 4 997 0110101110110010111001101011001010010100001110010100110011110101000001001111011100010010111110001101011010011100000010100011011011001000000000100101101110110000000011101001011110101001100101100101001100111100111000011000000100000111001110100001100101010111011111100010111011010110111100110011...

output:

011010111011001011100110101100101001010000111001010011001111010100000100111101110001001011111000110101101001110000001010001101101100100000000010010110111011000000001110100101111010100110010110010100110011110011100001100000010000011100111010000110010101011101111110001011101101011011110011001110111011...

input:

2 4 997
1 2 
11111010001101011010111010001010001010100111101101001111001110110011110101100101110111011000001101101011100000100111101110011100100000111100011111010111100000001000010011000111010100001010110001010011110000011111000101011001110110001110010011101011001001110000001101001110010110100001010...

output:

iunty23v7itdhugh3c011010111011001011100110101100101001010000111001010011001111010100000100111101110001001011111000110101101001110000001010001101101100100000000010010110111011000000001110100101111010100110010110010100110011110011100001100000010000011100111010000110010101011101111110001011101101011011...

result:

ok 

Test #36:

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

input:

2 4 997 1101111111010010000111101101000111110010000000000000010110011000010111001111011001011100110101011100011110010001100100100010000111101101011110100100011011111101000000101101101000111101100110110100111011101000101000000000110111000100000100010010101001101010001011110011000001111100010001110100...

output:

110111111101001000011110110100011111001000000000000001011001100001011100111101100101110011010101110001111001000110010010001000011110110101111010010001101111110100000010110110100011110110011011010011101110100010100000000011011100010000010001001010100110101000101111001100000111110001000111010000001101...

input:

2 4 997
0 3 
11011111110100100001111011010001111100100000000000000101100110000101110011110110010111001101010111000111100100011001001000100001111011010111101001000110111111010000001011011010001111011001101101001110111010001010000000001101110001000001000100101010011010100010111100110000011111000100011...

output:

iunty23v7itdhugh3c110111111101001000011110110100011111001000000000000001011001100001011100111101100101110011010101110001111001000110010010001000011110110101111010010001101111110100000010110110100011110110011011010011101110100010100000000011011100010000010001001010100110101000101111001100000111110001...

result:

ok 

Test #37:

score: 20
Accepted
time: 2ms
memory: 3564kb

input:

2 4 997 1101101000100010111011100011011001111111001110011010111011110010100010110111100100010111011100110011001011011001110111101110100101100010101111010011110010010001000101000011001000101110001100011000100110000001100010101001010010001110011100100000100010001100101010101011010000100111110001111011...

output:

110110100010001011101110001101100111111100111001101011101111001010001011011110010001011101110011001100101101100111011110111010010110001010111101001111001001000100010100001100100010111000110001100010011000000110001010100101001000111001110010000010001000110010101010101101000010011111000111101101001110...

input:

2 4 997
1 2 
01101001110110010110111110000100001101111011000010110010001000011001001011110011001011010000101100000101111101111100000010011110101001001001110111011100110011101000000001111101100100100001111000100111101001110001011101000101100010000000100110001100101101010000110000111011111100110011011...

output:

iunty23v7itdhugh3c110110100010001011101110001101100111111100111001101011101111001010001011011110010001011101110011001100101101100111011110111010010110001010111101001111001001000100010100001100100010111000110001100010011000000110001010100101001000111001110010000010001000110010101010101101000010011111...

result:

ok 

Test #38:

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

input:

2 4 997 0000000011011010010000111011010010000111100000000101010101101000010111000111110110001010010010000010100000100010100111001000111011111101000110111100001110111000111110100110010100101100000011000011100011010001100110101000000111000111101011100000010001011101101100010110001111001000000110100000...

output:

000000001101101001000011101101001000011110000000010101010110100001011100011111011000101001001000001010000010001010011100100011101111110100011011110000111011100011111010011001010010110000001100001110001101000110011010100000011100011110101110000001000101110110110001011000111100100000011010000000011111...

input:

2 4 997
3 2 
10010001011110001100101011011000000000010111011100110100101011111000111110000110000110101100000011100000001001110010111010100101000100100001010111001001000101101001000100100101000110011001100001110111011010010011000010010011110011110011000100000000000001111010101011000001001010000000001...

output:

iunty23v7itdhugh3c000000001101101001000011101101001000011110000000010101010110100001011100011111011000101001001000001010000010001010011100100011101111110100011011110000111011100011111010011001010010110000001100001110001101000110011010100000011100011110101110000001000101110110110001011000111100100000...

result:

ok 

Test #39:

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

input:

2 4 997 1101010001001001111111101011110101100100110111010011011100101101000101101010010101001111100110110010110001000011100111000110101111100001011110110100010100110001010011001101011100001101100100010001111110100110010000110000010000101111000101110011010110111100000100100000100011111010110111011001...

output:

110101000100100111111110101111010110010011011101001101110010110100010110101001010100111110011011001011000100001110011100011010111110000101111011010001010011000101001100110101110000110110010001000111111010011001000011000001000010111100010111001101011011110000010010000010001111101011011101100110110100...

input:

2 4 997
3 2 
10010100001101100000110001010001001010010110001101001000010110101001010100100011110011000001011111110010000111110111101101001111011110000010011011110101011110001111011010111011000110001001100000000010010001000010101111001010000011000010110011011110101011000101101100111010110101110100111...

output:

iunty23v7itdhugh3c110101000100100111111110101111010110010011011101001101110010110100010110101001010100111110011011001011000100001110011100011010111110000101111011010001010011000101001100110101110000110110010001000111111010011001000011000001000010111100010111001101011011110000010010000010001111101011...

result:

ok 

Test #40:

score: 20
Accepted
time: 2ms
memory: 3568kb

input:

2 4 997 0011011100011111000100000010001010000010110011001110111001010100011011111011110010110010101010001100011000010111101011100100101110100100100100011110001101000011011000011111010011000100001100000100101010000000100000010111011101111111011100011110111011101110001011010010011000100110111110001111...

output:

001101110001111100010000001000101000001011001100111011100101010001101111101111001011001010101000110001100001011110101110010010111010010010010001111000110100001101100001111101001100010000110000010010101000000010000001011101110111111101110001111011101110111000101101001001100010011011111000111111100101...

input:

2 4 997
0 2 
00110111000111110001000000100010100000101100110011101110010101000110111110111100101100101010100011000110000101111010111001001011101001001001000111100011010000110110000111110100110001000011000001001010100000001000000101110111011111110111000111101110111011100010110100100110001001101111100...

output:

iunty23v7itdhugh3c001101110001111100010000001000101000001011001100111011100101010001101111101111001011001010101000110001100001011110101110010010111010010010010001111000110100001101100001111101001100010000110000010010101000000010000001011101110111111101110001111011101110111000101101001001100010011011...

result:

ok 

Test #41:

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

input:

2 4 997 0010010101111001011101001101011100001111011011000001100110000011100111111011001101100101110010100000010100100000111100010011011110011101011110001101011110111110100011100010000011110011011011001101001101010100111101101100110011001011000110010010010101110010010101000010011111011101010001011100...

output:

001001010111100101110100110101110000111101101100000110011000001110011111101100110110010111001010000001010010000011110001001101111001110101111000110101111011111010001110001000001111001101101100110100110101010011110110110011001100101100011001001001010111001001010100001001111101110101000101110001001110...

input:

2 4 997
0 1 
00100101011110010111010011010111000011110110110000011001100000111001111110110011011001011100101000000101001000001111000100110111100111010111100011010111101111101000111000100000111100110110110011010011010101001111011011001100110010110001100100100101011100100101010000100111110111010100010...

output:

iunty23v7itdhugh3c001001010111100101110100110101110000111101101100000110011000001110011111101100110110010111001010000001010010000011110001001101111001110101111000110101111011111010001110001000001111001101101100110100110101010011110110110011001100101100011001001001010111001001010100001001111101110101...

result:

ok 

Test #42:

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

input:

2 4 997 0110110001101000000110100001101110000011010000011001100010110111010110111110011001111010001011011100011011110101111010000111101110000110100100010001101101011000101011101011001011001011010100101110011010111110011001100110111110000010011101010011000110000101001100000000011001101110001111000010...

output:

011011000110100000011010000110111000001101000001100110001011011101011011111001100111101000101101110001101111010111101000011110111000011010010001000110110101100010101110101100101100101101010010111001101011111001100110011011111000001001110101001100011000010100110000000001100110111000111100001001101101...

input:

2 4 997
0 2 
01101100011010000001101000011011100000110100000110011000101101110101101111100110011110100010110111000110111101011110100001111011100001101001000100011011010110001010111010110010110010110101001011100110101111100110011001101111100000100111010100110001100001010011000000000110011011100011110...

output:

iunty23v7itdhugh3c011011000110100000011010000110111000001101000001100110001011011101011011111001100111101000101101110001101111010111101000011110111000011010010001000110110101100010101110101100101100101101010010111001101011111001100110011011111000001001110101001100011000010100110000000001100110111000...

result:

ok 

Test #43:

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

input:

2 4 997 1100110011100011111100010110000110010010111100000110010000001110101110101111101100010100111110100100001101010110101000110000101100001101001101011100110110110011010011011000000101101101011010101000000010110001101111000011011001101001011010111101010111100011000000011011111101010100110100010111...

output:

110011001110001111110001011000011001001011110000011001000000111010111010111110110001010011111010010000110101011010100011000010110000110100110101110011011011001101001101100000010110110101101010100000001011000110111100001101100110100101101011110101011110001100000001101111110101010011010001011100111111...

input:

2 4 997
1 0 
01000100110100000000010101111010101110101111100011111001111001010101001110010010001110001011111011110100111100101000010011011111111100001001011100111000011101001000001010000100001010000011011101100011000010101100011010110011100101000000000101011100111001011000000100011100101111001001111...

output:

iunty23v7itdhugh3c110011001110001111110001011000011001001011110000011001000000111010111010111110110001010011111010010000110101011010100011000010110000110100110101110011011011001101001101100000010110110101101010100000001011000110111100001101100110100101101011110101011110001100000001101111110101010011...

result:

ok 

Test #44:

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

input:

2 4 997 0001100110100101101101010001010011011001101101101110011001010100000111111100000011111101100111001101101011101011010000100011100011111000111100010110101001100100000100000001110010100010110000011001010110011001100010110011101001010111110001011100111101100000101011011001001011111001111110010000...

output:

000110011010010110110101000101001101100110110110111001100101010000011111110000001111110110011100110110101110101101000010001110001111100011110001011010100110010000010000000111001010001011000001100101011001100110001011001110100101011111000101110011110110000010101101100100101111100111111001000000101111...

input:

2 4 997
1 3 
11101001110011000011111010110101011010011101010100111100001111110001001100111001001011110110010111000000001110000011110101011110111111111111110010100101011001101011001010010001010111101101000111101110110001010110001000110000111011001010010101000100010100001101110111010001110001111001000...

output:

iunty23v7itdhugh3c000110011010010110110101000101001101100110110110111001100101010000011111110000001111110110011100110110101110101101000010001110001111100011110001011010100110010000010000000111001010001011000001100101011001100110001011001110100101011111000101110011110110000010101101100100101111100111...

result:

ok 

Test #45:

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

input:

2 4 997 0000001000100010000111111000000101110100001001010111001111010100000011110001101101011100101111011100000110001011111000001001111011010100010111010101010000111000010110010010111101110110101000010100001100010000110011101110100110000010000111101100101001000001110111001100000100000100110111100001...

output:

000000100010001000011111100000010111010000100101011100111101010000001111000110110101110010111101110000011000101111100000100111101101010001011101010101000011100001011001001011110111011010100001010000110001000011001110111010011000001000011110110010100100000111011100110000010000010011011110000101110000...

input:

2 4 997
1 0 
11011010101011000010010000100101111110011110001001110111001111101111111101011111100110100101010010000010010110101111111001101010101111101111111110110000011101100011100001000011111110011001111111000100000010100001100001101110000001011011010101111110101010001010111000011000001011011101111...

output:

iunty23v7itdhugh3c000000100010001000011111100000010111010000100101011100111101010000001111000110110101110010111101110000011000101111100000100111101101010001011101010101000011100001011001001011110111011010100001010000110001000011001110111010011000001000011110110010100100000111011100110000010000010011...

result:

ok 

Test #46:

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

input:

2 4 997 1101111001001011101000011101011010101001010111100000010101101011111010110111000010001010100110001000010011000101110100100111101101011111101111011111010000010001001101110010000110000010010110011001001010111111000010110001011000101110100101001010010111100100011011010011011100010100011111111000...

output:

110111100100101110100001110101101010100101011110000001010110101111101011011100001000101010011000100001001100010111010010011110110101111110111101111101000001000100110111001000011000001001011001100100101011111100001011000101100010111010010100101001011110010001101101001101110001010001111111100011001001...

input:

2 4 997
0 3 
11011110010010111010000111010110101010010101111000000101011010111110101101110000100010101001100010000100110001011101001001111011010111111011110111110100000100010011011100100001100000100101100110010010101111110000101100010110001011101001010010100101111001000110110100110111000101000111111...

output:

iunty23v7itdhugh3c110111100100101110100001110101101010100101011110000001010110101111101011011100001000101010011000100001001100010111010010011110110101111110111101111101000001000100110111001000011000001001011001100100101011111100001011000101100010111010010100101001011110010001101101001101110001010001...

result:

ok 

Test #47:

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

input:

2 4 997 1100000101010010111011000010010111010110111001101101101111011101110101101110010000011001101011100000001101000110110001000011101010101111010100111111101100000100010101010111101010101011100010000111100011100101110011010111101100010000110010011100101101100101111110001101011100110110000011101010...

output:

110000010101001011101100001001011101011011100110110110111101110111010110111001000001100110101110000000110100011011000100001110101010111101010011111110110000010001010101011110101010101110001000011110001110010111001101011110110001000011001001110010110110010111111000110101110011011000001110101001011000...

input:

2 4 997
0 3 
11000001010100101110110000100101110101101110011011011011110111011101011011100100000110011010111000000011010001101100010000111010101011110101001111111011000001000101010101111010101010111000100001111000111001011100110101111011000100001100100111001011011001011111100011010111001101100000111...

output:

iunty23v7itdhugh3c110000010101001011101100001001011101011011100110110110111101110111010110111001000001100110101110000000110100011011000100001110101010111101010011111110110000010001010101011110101010101110001000011110001110010111001101011110110001000011001001110010110110010111111000110101110011011000...

result:

ok 

Test #48:

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

input:

2 4 997 0101100101001100100011111011001111111101111100010000101001110111010001101001010001001010001001111000101010000111100000001001010101000110011001001101011111100000100111000010010000001111110011110100001011111001110010110000100011111010110101010110110100100100101111001001010100010011100011101001...

output:

010110010100110010001111101100111111110111110001000010100111011101000110100101000100101000100111100010101000011110000000100101010100011001100100110101111110000010011100001001000000111111001111010000101111100111001011000010001111101011010101011011010010010010111100100101010001001110001110100101010000...

input:

2 4 997
2 3 
00001110100010011011000100001111011111101010100010101100010101000000100000111000101011110000111100010011101000001110111000011010100010010101100100001101101110101000001010110111011010100010011101110010010111010101000110010111111101010111000001010110101001010110100101110001111100110011111...

output:

iunty23v7itdhugh3c010110010100110010001111101100111111110111110001000010100111011101000110100101000100101000100111100010101000011110000000100101010100011001100100110101111110000010011100001001000000111111001111010000101111100111001011000010001111101011010101011011010010010010111100100101010001001110...

result:

ok 

Subtask #4:

score: 25
Accepted

Test #49:

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

input:

3 5 997 0000010100111001110011100111100000111111111111000110001011000000110110111100110101100100011010000101010000110011111010111000100011100000000111010111111001000001000000110001010101011111001100000110111000100001110111000010010101011100110101111111001010110110111000111101000111010110100100010010...

output:

100010010111111111101010011101001001101001100110001000111001001010100101011011011001001100111000000010100011000101011011100100000100001011011000010110111101011111110010011011100110010111011000010001001100100001110101001000001010110100011011111111101111000110011111100101000101010011011011111010100010...

input:

3 5 997
2 4 1 
011011111101001010110011100100011100100101001111000011011100101000001101010100100010000010110110110000011101010001110111000111000001101000010100111001000011101010001100101101001100101001000000011100101011011011011000001001010011000011011010010011101110001000000000001100111000011011010...

output:

iunty23v7itdhugh3c000001010011100111001110011110000011111111111100011000101100000011011011110011010110010001101000010101000011001111101011100010001110000000011101011111100100000100000011000101010101111100110000011011100010000111011100001001010101110011010111111100101011011011100011110100011101011010...

result:

ok 

Test #50:

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

input:

3 5 997 1001001000001111111110111011001010001100011010011001011100101010100111000111000001010100100110001111111110111001111111101001110111100010110000100111000000011001001111001011100001000001010101100111111011000010100100111011010111110100110000000001100100001111010111101010110100100100100100011100...

output:

100111110110000011111100111110100101100101010110011101101001010101100111111100110100001111110000101110111000011000111001111011111010000010011011001010100100010000100000111011110010010000001001000001111011110111100110110110110010011101011100011110101000010001111100110011111011011101100110001110101000...

input:

3 5 997
3 1 0 
001000000011111100100100010111111111111101010011101111011111011111000101101110011111000101011000000100101110100011001001001011111011111011001111100000000111001010100000101101100111011001001100001100000001011100100100111111000011110000011000011100110010011001100010101111111011101110111...

output:

iunty23v7itdhugh3c100100100000111111111011101100101000110001101001100101110010101010011100011100000101010010011000111111111011100111111110100111011110001011000010011100000001100100111100101110000100000101010110011111101100001010010011101101011111010011000000000110010000111101011110101011010010010010...

result:

ok 

Test #51:

score: 25
Accepted
time: 2ms
memory: 3656kb

input:

3 5 997 0110000110001110010110111100100111100010000000100101010101101100011100011010101011100001110100010011111101011100000110010110101011000101111000110111101101000100000001000000100011111001101000000001001011111011111101010111010000010000101110101110111101000011110011100111000110100001000010000000...

output:

111010011110111100001011011000010000111100110110001010011001010001110001000011011110010110110011000110010000001111011011111110001010100001101000010011010000100001001101011011110100111111111111100100101111011101001110100000101010111000011101100011110010010000010111011100001010010000001100111010101111...

input:

3 5 997
1 3 0 
001100010001100001001010001110100000110111100101100011010011010000101101011101111110110000100011000101101011110101010000110011101000100111101001001101101100001110111101010110000110100010000101100111011100111110101010001010111001001111001110001100000111111111011101101101101001011101000...

output:

iunty23v7itdhugh3c011000011000111001011011110010011110001000000010010101010110110001110001101010101110000111010001001111110101110000011001011010101100010111100011011110110100010000000100000010001111100110100000000100101111101111110101011101000001000010111010111011110100001111001110011100011010000100...

result:

ok 

Test #52:

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

input:

3 5 997 1010101001110111011111001000000000011110111001111100000110100010001101000001111100101010011010010100101001100101110111011110100000001010111110010100001011101110011010011000111100010011011111111100000111001011011010101100110100111111100110100100000000110000010101010101000000110000110100101111...

output:

010111101111111100011010111001101001000000010000000110110000100111000101001001100100001011001101011011101100111000111000011001110110111010110110011101001000110010111110000110111000111011100111111100001011100110111000110111001010101010101110100000101010101010000100101111100001001000011001101011111111...

input:

3 5 997
1 0 4 
111110111111111111101000101010110100011011101001101111100100001011111100101101101110110111000101011010011010111101011011000100111001001101110101001010001110000011101111001011010000110011100000100010100001000101010101110001001111111010000000011100101001000001001001010110111111010001110...

output:

iunty23v7itdhugh3c101010100111011101111100100000000001111011100111110000011010001000110100000111110010101001101001010010100110010111011101111010000000101011111001010000101110111001101001100011110001001101111111110000011100101101101010110011010011111110011010010000000011000001010101010100000011000011...

result:

ok 

Test #53:

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

input:

3 5 997 1001001101110001011001101100011101010010000011010110000110010000111001100011111100100110101101100111000111101111100100110111110110111100000011100000111001011110110111101000101110010011011000011011001011111111011000101100110011110110000110100100101011110100010001011000000100110001100101111011...

output:

100111000000100100100101110010000110010011110100001001101101101111101101010001000011011010110010010100011010000010011000110000001110001101010010001111100000001100100010010001001110010010011010101001101010011100100010111000101100111000001001001010110111011001100001100101000110011000000001111100101000...

input:

3 5 997
0 1 3 
100111000000100100100101110010000110010011110100001001101101101111101101010001000011011010110010010100011010000010011000110000001110001101010010001111100000001100100010010001001110010010011010101001101010011100100010111000101100111000001001001010110111011001100001100101000110011000000...

output:

iunty23v7itdhugh3c100100110111000101100110110001110101001000001101011000011001000011100110001111110010011010110110011100011110111110010011011111011011110000001110000011100101111011011110100010111001001101100001101100101111111101100010110011001111011000011010010010101111010001000101100000010011000110...

result:

ok 

Test #54:

score: 25
Accepted
time: 2ms
memory: 3592kb

input:

3 5 997 0110101101011000100011000000111111001000001000010101001011011101110100000101001110011001101011111101101011111111011000010100110100100110110100110010110111100001101011010011010110101111010110111010111111100010100110001110001111000101010101011101100001011101010101110010111001100111110101111001...

output:

110011111100111011111010000100001111110001011111011010100000101101100000000111011001101100111000010011001100101100000011100101011110010000011011100100101010111111010111011110011110010101100110100001100101011100000100001101101000001111011110010100110101111111010001111001010010011100100110111101100110...

input:

3 5 997
2 4 0 
010101010101011100000000111111100010111011000011100111001001010111010011100101101011000000001000101111101011110101100011000011000010100001100111111100101110101111110100000001011010101001000111111111100010000001010110101000110011101010000001001100011100101111000110111111101011100000001...

output:

iunty23v7itdhugh3c011010110101100010001100000011111100100000100001010100101101110111010000010100111001100110101111110110101111111101100001010011010010011011010011001011011110000110101101001101011010111101011011101011111110001010011000111000111100010101010101110110000101110101010111001011100110011111...

result:

ok 

Test #55:

score: 25
Accepted
time: 2ms
memory: 3856kb

input:

3 5 997 0000100101110000101110001000001101001010110010010001000010011110010101101000111011011111101101001000111001010000110010010100110100100111000010100101001000000000000011101001011001010111010001100111011011100011011100101101011111110011011000101101001110000010010001000101110010110011011001011100...

output:

001000010001011111011000101001110011100110111100000110100010110011110101001000110001000101100001011010111010000000101101101110111011011101110000110010011110101101000100011010101101011111111101110001000110011110110110111100111110011001100001111110011010110011101110110110001111111110011000000000000110...

input:

3 5 997
3 2 0 
001101111011100010100110011011111000011001001111010001010010001010110101001011111101101010011110111110011110110000010110100001011001000010001010000100101101101101101111000011010111100000011001001100110110010000010011001011000001001101101101010110011011101001111111111111101110001010111...

output:

iunty23v7itdhugh3c000010010111000010111000100000110100101011001001000100001001111001010110100011101101111110110100100011100101000011001001010011010010011100001010010100100000000000001110100101100101011101000110011101101110001101110010110101111111001101100010110100111000001001000100010111001011001101...

result:

ok 

Test #56:

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

input:

3 5 997 1110101000111001100010110010100001100110000111101010010100100011101000101110101111110011000001001100001100110010110110010100111000010000000010010111011001000101000111111101111000110110110100101100000111001001001101101111110100101011110011111001110101000011000111110111001001001000101001101001...

output:

100011000111101000110000010001110100100001000100010000000100001111010011000111100011110010101000011101001001001010010110000100011010001101111011011001101000111100111101101110110101001010111100001010000011101101111001100111011000000101101011010101011111111011011011100100000010110001110110000011001011...

input:

3 5 997
2 3 4 
111011000001011101110010110011000110011000000110001100110011010111110101110100000110011010000011100101010010001100010100101111110011001100100000111010111010001111101110010110011000010100101011011111001000101111100111110101011011001000010000000000111010100011000100001011110100010111100...

output:

iunty23v7itdhugh3c111010100011100110001011001010000110011000011110101001010010001110100010111010111111001100000100110000110011001011011001010011100001000000001001011101100100010100011111110111100011011011010010110000011100100100110110111111010010101111001111100111010100001100011111011100100100100010...

result:

ok 

Test #57:

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

input:

3 5 997 1000000110001100000001100011101110100011100111110101101101010100001101110011011100110001000111000001010111101000110001111010010110000001111111100110011110100001111001001011001000011100001110111011000110100000100101111100010111110011101001111101100010110111010100111100011111100101111001010000...

output:

110011000010110010101011010100111011100000111010110000101111100000100000010000110000000010111110001000011110110110010111101011111110011110011101111100101000010100101110011011101001000101001000110100100010011000100001110011111111110011010000011011011011100110010000100101011111010111111000001100101110...

input:

3 5 997
2 0 4 
101011010001110001100001110101001010001111011001001101110110011001100011111100110101111010101101011010001100010110001101001010101011100011010001010111001010110011100101010101010110001101111000010011101010000101110111111010100111010110110111110011111010000010001011100011001011000011110...

output:

iunty23v7itdhugh3c100000011000110000000110001110111010001110011111010110110101010000110111001101110011000100011100000101011110100011000111101001011000000111111110011001111010000111100100101100100001110000111011101100011010000010010111110001011111001110100111110110001011011101010011110001111110010111...

result:

ok 

Test #58:

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

input:

3 5 997 0100101001011010110000011100010101000101111010001000111011101010001110000101111011101000000101110100110100000010000100011000000111100010111101000011000001101001100000101010001001111010101001100000101001010101110100010011111110011100001010110011000101100111011000001000001101111110010001101111...

output:

111000101111100011001001101011000001011010110110111110100000111111001000110101100111010001011000011010011100010001100111110101110101111101111111101111011101110100111110010000011101001100011001011100111001101100110011001000000001111101000110011100000111011110011110111110001100000011111010101011101101...

input:

3 5 997
1 0 2 
110001011010111100111000001011110000110011111011101110010110011111000011110111000001100010010011110001110100100110000011010101010011101010101000101010011000011010101110001000001101010001111000001110110011110100101110111001010010001101010000111101000001010011111111011111000001011100010...

output:

iunty23v7itdhugh3c010010100101101011000001110001010100010111101000100011101110101000111000010111101110100000010111010011010000001000010001100000011110001011110100001100000110100110000010101000100111101010100110000010100101010111010001001111111001110000101011001100010110011101100000100000110111111001...

result:

ok 

Test #59:

score: 25
Accepted
time: 2ms
memory: 3636kb

input:

3 5 998 0100101100001010100010001011100111000101111000001000101110000001000001101000010110110011111110110100001011011000111100101000101000100010110010010010100000110011010010000011101100001110000101110100110101000010110111101001111011100010101101110001101100010001110100110110011110110101011100011000...

output:

110101010100001110101011101000100100001111100111101100110010110010100011001010001100011011111111111111111110011001011010000111001010001100001010011011010111101101011111011011011000110001110110000010001111011110111111010110010010100101010110100001101010011010011011100110100110010010010100101010011000...

input:

3 5 998
4 1 0 
100111100100100100100011000110111000011000000111001110001010110110100101101011010111010100000100101111010011111010101000100101101000000111000011010001010100100000010111010101101000001001100001010001011011010101100001110001111100101111100001100111011011011101001000111111011101000111100...

output:

iunty23v7itdhugh3c010010110000101010001000101110011100010111100000100010111000000100000110100001011011001111111011010000101101100011110010100010100010001011001001001010000011001101001000001110110000111000010111010011010100001011011110100111101110001010110111000110110001000111010011011001111011010101...

result:

ok 

Test #60:

score: 25
Accepted
time: 2ms
memory: 3664kb

input:

3 5 998 0101101011010000011010000000110110010100011111011111010011011010110000100111100100010011110001010010101001001111100111000010110100000010000100111110000011011000000110001100000100110000010110011110110100001100101000111110000011010001011011100111100000111011110001010010000011010111001000101011...

output:

101001001100001110010011101010011110101100110111111001110000100110011010111000101110101000100100011111000000110110100110010110111111001011100011100011110010101110010011110011000000010010101100001100010011000001111010011110101001011100010110101110010110000011100110100111011001010101000010101011101110...

input:

3 5 998
2 1 3 
110000000010110100100101101010100011110011011000000000011100010011011001101010000011110110001010100110000110000010101110110011111101110010110111001010101001111001001111011110010000010010011110111101110001110010110101110010011001011011000110001000001010001101000100110111011100101001100...

output:

iunty23v7itdhugh3c010110101101000001101000000011011001010001111101111101001101101011000010011110010001001111000101001010100100111110011100001011010000001000010011111000001101100000011000110000010011000001011001111011010000110010100011111000001101000101101110011110000011101111000101001000001101011100...

result:

ok 

Test #61:

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

input:

3 5 998 1010010011101101011010000001011111100000001110101101010000111111000100111011101100101110010001000000100001100001001010010010111001001111101100111001000011010100001011110001000001101010111101001110001010111011110100010011110011011010010100011110010001100110010010001001001001100010000010011001...

output:

100010111010110101011101101000010111101110101110000010101111111000101100100001010010001010101101100111001010011101110100011000001010101011010111001010110100010010110100111101110111111111011100010001010100101110010000011000100100111011001110011010100011010001111011101011111010110101001011100010101111...

input:

3 5 998
4 0 3 
001011110100000000110101101101101001101110010100110111101100000100111111001111100000110011101001100101001100011001011101010011101110010101100100101110111001000010011011111001110001010100101000101001111111000001000001010111101001010010011111100011100101001000110011001111011100111101000...

output:

iunty23v7itdhugh3c101001001110110101101000000101111110000000111010110101000011111100010011101110110010111001000100000010000110000100101001001011100100111110110011100100001101010000101111000100000110101011110100111000101011101111010001001111001101101001010001111001000110011001001000100100100110001000...

result:

ok 

Test #62:

score: 25
Accepted
time: 2ms
memory: 3660kb

input:

3 5 998 1001100110101101010011001110010110010000011111010100000011110001000100101011010000000011111001100101101001010010010000110011101010000100111010001000011111101011101101100110110100011011010011101011110000100100001100001001000111100100010000001111111010001011100110101101100010111111011011110110...

output:

110001011101110110010010111100101001001011101100111100011010111010011010100100001111111011101100101010001110000100110111010001101100111100011001001100011010011001000101001111100111010110110111111101111010011101111101000011111110000001001111000001011011101110101101011101110001001000010001001111010011...

input:

3 5 998
1 0 4 
111011101001110111001100110101011011011000101101110111001111010000011000001111001111000010000000011101000110110100111000111011001110111000100101111111111111010011110101001101011111001010001111010011000110010001110111010110111010000101110001100000011010011100111111010011110011000111010...

output:

iunty23v7itdhugh3c100110011010110101001100111001011001000001111101010000001111000100010010101101000000001111100110010110100101001001000011001110101000010011101000100001111110101110110110011011010001101101001110101111000010010000110000100100011110010001000000111111101000101110011010110110001011111101...

result:

ok 

Test #63:

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

input:

3 5 998 1100110010010001001111100001101100110111110101011001000111111100010001000000111101001110011000110101101001011110100001110000001011011011111001100000111110001100101011001110100110110101000010010000111001011000011010100110000110110110010000001110100110011001010101110001011010100011011100011100...

output:

100001011111100001101101100111010110011111001000101110000011010011110000011001101101000001110011001111100001100011100000000110010101110000111110111110000000101100101001110001111011100000111101001101010001010000100101111101100100001000110111011100110010101000111010100111011000101110000000001010100011...

input:

3 5 998
2 3 0 
110101000011010000100000101110001001010110010111111011001010101011010001001010111110001000010101111011001011101100011100010000101100100010000010111111100100110001011010110101100000110000110001110110111000101011001110100010001011101010110010010110100001000110011001110010011001011011001...

output:

iunty23v7itdhugh3c110011001001000100111110000110110011011111010101100100011111110001000100000011110100111001100011010110100101111010000111000000101101101111100110000011111000110010101100111010011011010100001001000011100101100001101010011000011011011001000000111010011001100101010111000101101010001101...

result:

ok 

Test #64:

score: 25
Accepted
time: 2ms
memory: 3576kb

input:

3 5 998 0111101010101011001000111010110001101010111001101001111101011100010010001101011110110100111111101111011100010111111111011101111110111101110010100011101100101001011111100100110101011101100100110000001110101010011011010011100111111111110010100000001011110101111110000000011100001011100001111010...

output:

110011111101001101100100010000100111101110101011101010101111111001101111000100011111110110101101000110100001010011110010011101100100010110101111000011110001110100010100011100101000001110011110000110001010100111010110010110011111111010010010011101011100000110111001001111001111101100101111011110011111...

input:

3 5 998
3 2 1 
100010101001001110011101110100011000111100000100110011101111001101111011101100010001100110011100100000110011111100000010110011110111010100010010010110100100010111010111100110011101110010001011110010100010000011000101001001111111010110011000010000100010010100110010110111110111010000100...

output:

iunty23v7itdhugh3c011110101010101100100011101011000110101011100110100111110101110001001000110101111011010011111110111101110001011111111101110111111011110111001010001110110010100101111110010011010101110110010011000000111010101001101101001110011111111111001010000000101111010111111000000001110000101110...

result:

ok