QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#740121 | #503. IP over Avian Carrier | I_be_wanna | 100 ✓ | 2ms | 3880kb | C++20 | 14.3kb | 2024-11-13 01:25:52 | 2024-11-13 01:25:53 |
Judging History
Program
#include<bits/stdc++.h>
#include "avian.h"
using namespace std;
using ll = int;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
#define M(i) (1LL<<(i))
#define MP make_pair
#define ms(a) memset(a,0,sizeof (a))
namespace {
struct way{
ll c,k,times;
vector <vector <ll> > a;
};
way all[4];
ll cv(string s){
ll res = 0;
for (auto x:s)res ^= MASK(x-'0');
return res;
}
bool check_basis(vector <ll> a){
ll n = sz(a);
vector <ll> basis(n);
for (auto x:a){
for (ll i = n-1;i>=0;i--){
if (BIT(x,i)){
if (basis[i])x^=basis[i];
else {basis[i]=x;break;}
}
}
}
bool res = 1;
for (ll i = 0;i < n; i++)res&=basis[i]!=0;
return res;
}
bool check_way(ll i){
vector <ll> a(all[i].c);
bool ok = 1;
function <void(ll,ll)> brute = [&](ll j1,ll j2){
if (!ok)return;
if (j1 == all[i].c){
vector <ll> res;
for (auto x:a)res.insert(res.end(),all[i].a[x].begin(),all[i].a[x].end());
if (!check_basis(res))ok=0;
return;
}
if (j2 == all[i].k)return;
for (ll k2 = j2;k2 < all[i].k;k2 ++){
a[j1] = k2;
brute(j1+1,k2+1);
}
};
brute(0,0);
return ok;
}
void complete_way(ll i){
if (all[i].a[all[i].k-1].back()!=-1)assert(check_way(i));
else{
ll maxbit = all[i].c*all[i].times;
bool ok = 0;
function <void(ll)> brute = [&](ll j){
if (j==all[i].times){
if (check_way(i))ok=1;
return;
}
for (ll k = 0;!ok && k < MASK(maxbit);k ++){
all[i].a[all[i].k-1][j] = k;
brute(j+1);
}
};
brute(0);
assert(check_way(i));
}
}
void init(){
all[0].c=2,all[0].k=4,all[0].times=2;
all[0].a.resize(all[0].k);
all[0].a[0] = {cv("0"),cv("1")};all[0].a[1]={cv("2"),cv("3")};all[0].a[2] = {cv("02"),cv("13")};all[0].a[3] = {cv("012"),cv("123")};
all[1].c=2,all[1].k=4,all[1].times=3;
all[1].a.resize(all[1].k);
all[1].a[0] = {cv("0"),cv("1"),cv("2")};all[1].a[1] = {cv("3"),cv("4"),cv("5")};all[1].a[2] = {cv("03"),cv("14"),cv("25")};all[1].a[3] = {cv("023"),cv("134"),cv("245")};
all[2].c=3,all[2].k=5,all[2].times=2;
all[2].a.resize(all[2].k);
all[2].a[0] = {cv("0"),cv("1")};all[2].a[1]={cv("2"),cv("3")};all[2].a[2]={cv("4"),cv("5")};all[2].a[3] = {cv("024"),cv("135")};all[2].a[4] = {cv("0134"),cv("0235")};
all[3].c=3,all[3].k=5,all[3].times=3;
all[3].a.resize(all[3].k);
all[3].a[0] = {cv("0"),cv("1"),cv("2")};all[3].a[1] = {cv("3"),cv("4"),cv("5")};all[3].a[2] = {cv("6"),cv("7"),cv("8")};all[3].a[3] = {cv("036"),cv("147"),cv("258")};all[3].a[4] = {cv("0146"),cv("1257"),cv("012348")};
for (ll j = 0;j < 4;j ++)complete_way(j);
}
vector <string> cv1(ll type,string X){
vector <string> res(all[type].k);
for (ll i = 0;i < all[type].k;i ++){
string s;s.resize(all[type].times);
for (ll j = 0;j < all[type].times;j ++){
ll xr = 0;
for (ll k = 0;k < 10;k ++){
if (BIT(all[type].a[i][j],k)){
xr ^= X[k]-'0';
}
}
s[j] = xr+'0';
}
res[i] = s;
}
return res;
}
string cv2(ll type,vector <string> res,vector <ll> id){
string X;X.resize(all[type].c*all[type].times);
// cout<<"TYPE "<<type<<endl;
// for (ll i = 0;i < sz(id);i ++){
// cout<<id[i]<<' '<<res[i]<<endl;
// }
vector <pll> basis(sz(X));
vector <pll> a;
for (ll i1 = 0;i1 < sz(id);i1 ++){
ll i = id[i1];
for (ll j = 0;j < all[type].times;j ++){
a.push_back({all[type].a[i][j],res[i1][j]-'0'});
}
}
// for (auto x:a){
// cout<<x.fi<<' '<<x.se<<endl;
// }
for (auto x:a){
for (ll i = sz(X)-1;i>=0;i--){
if (BIT(x.fi,i)){
if (basis[i].fi){
x.fi^=basis[i].fi;
x.se^=basis[i].se;
}
else{
basis[i] = x;
break;
}
}
}
}
for (ll i = 0;i < sz(X);i ++){
ll mask = MASK(i);
ll ans = 0;
for (ll j = sz(X)-1;j>=0;j--){
if (BIT(mask,j)){
mask^=basis[j].fi;
ans^=basis[j].se;
}
}
X[i] = ans+'0';
}
return X;
}
vector<string> penis(ll c, ll k, ll n, string X) {
init();
vector <string> res(k);
if (n%2==0){
for (ll i = 0;i < n;i += 2){
string tmp(X,i*c,2*c);
vector <string> sus = cv1(0+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
}
else{
for (ll i = 0;i < n-3;i += 2){
string tmp(X,i*c,2*c);
vector <string> sus = cv1(0+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
string tmp(X,(n-3)*c,3*c);
vector <string> sus = cv1(1+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
return res;
}
string pussy(ll c,ll k,ll n,vector <string> Y,vector <ll> I){
init();
string ans;
if (n % 2 == 0){
for (ll i = 0;i < n;i += 2){
vector <string> res(c);
vector <ll> id(c);
for (ll j = 0;j < c;j ++){
res[j] = Y[j].substr(i,2);
id[j] = I[j];
}
ans += cv2(0+(c==3)*2,res,id);
}
}
else{
for (ll i = 0;i < n-3;i += 2){
vector <string> res(c);
vector <ll> id(c);
for (ll j = 0;j < c;j ++){
res[j] = Y[j].substr(i,2);
id[j] = I[j];
}
ans += cv2(0+(c==3)*2,res,id);
}
vector <string> res(c);
vector <ll> id(c);
for (ll j = 0;j < c;j ++){
res[j] = Y[j].substr(n-3,3);
id[j] = I[j];
}
ans += cv2(1+(c==3)*2,res,id);
}
return ans;
}
}
vector<string> encode(int C, int K, int N, string X) {
return penis(C,K,N,X);
}
string decode(int C, int K, int N, vector<string> Y, vector<int> I) {
return pussy(C,K,N,Y,I);
}
/*#include<bits/stdc++.h>
#include "avian.h"
using namespace std;
using ll = int;
using ull = unsigned long long;
using ld = long double;
#define pll pair <ll,ll>
#define fi first
#define se second
#define sz(a) (ll((a).size()))
#define BIT(mask,i) (((mask) >> (i))&1LL)
#define MASK(i) (1LL << (i))
#define M(i) (1LL<<(i))
#define MP make_pair
#define ms(a) memset(a,0,sizeof (a))
namespace {
struct way{
ll c,k,times;
vector <vector <ll> > a;
};
way all[4];
ll cv(string s){
ll res = 0;
for (auto x:s)res ^= MASK(x-'0');
return res;
}
bool check_basis(vector <ll> a){
ll n = sz(a);
vector <ll> basis(n);
for (auto x:a){
for (ll i = n-1;i>=0;i--){
if (BIT(x,i)){
if (basis[i])x^=basis[i];
else {basis[i]=x;break;}
}
}
}
bool res = 1;
for (ll i = 0;i < n; i++)res&=basis[i]!=0;
return res;
}
bool check_way(ll i){
vector <ll> a(all[i].c);
bool ok = 1;
function <void(ll,ll)> brute = [&](ll j1,ll j2){
if (!ok)return;
if (j1 == all[i].c){
vector <ll> res;
for (auto x:a)res.insert(res.end(),all[i].a[x].begin(),all[i].a[x].end());
if (!check_basis(res))ok=0;
return;
}
if (j2 == all[i].k)return;
for (ll k2 = j2;k2 < all[i].k;k2 ++){
a[j1] = k2;
brute(j1+1,k2+1);
}
};
brute(0,0);
return ok;
}
void complete_way(ll i){
if (all[i].a[all[i].k-1].back()!=-1)assert(check_way(i));
else{
ll maxbit = all[i].c*all[i].times;
bool ok = 0;
function <void(ll)> brute = [&](ll j){
if (j==all[i].times){
if (check_way(i))ok=1;
return;
}
for (ll k = 0;!ok && k < MASK(maxbit);k ++){
all[i].a[all[i].k-1][j] = k;
brute(j+1);
}
};
brute(0);
assert(check_way(i));
}
}
void init(){
all[0].c=2,all[0].k=4,all[0].times=2;
all[0].a.resize(all[0].k);
all[0].a[0] = {cv("0"),cv("1")};all[0].a[1]={cv("2"),cv("3")};all[0].a[2] = {cv("02"),cv("13")};all[0].a[3] = {cv("012"),cv("123")};
all[1].c=2,all[1].k=4,all[1].times=3;
all[1].a.resize(all[1].k);
all[1].a[0] = {cv("0"),cv("1"),cv("2")};all[1].a[1] = {cv("3"),cv("4"),cv("5")};all[1].a[2] = {cv("03"),cv("14"),cv("25")};all[1].a[3] = {cv("023"),cv("134"),cv("245")};
all[2].c=3,all[2].k=5,all[2].times=2;
all[2].a.resize(all[2].k);
all[2].a[0] = {cv("0"),cv("1")};all[2].a[1]={cv("2"),cv("3")};all[2].a[2]={cv("4"),cv("5")};all[2].a[3] = {cv("024"),cv("135")};all[2].a[4] = {cv("0134"),cv("0235")};
all[3].c=3,all[3].k=5,all[3].times=3;
all[3].a.resize(all[3].k);
all[3].a[0] = {cv("0"),cv("1"),cv("2")};all[3].a[1] = {cv("3"),cv("4"),cv("5")};all[3].a[2] = {cv("6"),cv("7"),cv("8")};all[3].a[3] = {cv("036"),cv("147"),cv("258")};all[3].a[4] = {cv("0146"),cv("1257"),cv("012348")};
for (ll j = 0;j < 4;j ++)complete_way(j);
}
vector <string> cv1(ll type,string X){
vector <string> res(all[type].k);
for (ll i = 0;i < all[type].k;i ++){
string s;s.resize(all[type].times);
for (ll j = 0;j < all[type].times;j ++){
ll xr = 0;
for (ll k = 0;k < 10;k ++){
if (BIT(all[type].a[i][j],k)){
xr ^= X[k]-'0';
}
}
s[j] = xr+'0';
}
res[i] = s;
}
return res;
}
string cv2(ll type,vector <string> res,vector <ll> id){
string X;X.resize(all[type].c*all[type].times);
// cout<<"TYPE "<<type<<endl;
// for (ll i = 0;i < sz(id);i ++){
// cout<<id[i]<<' '<<res[i]<<endl;
// }
vector <pll> basis(sz(X));
vector <pll> a;
for (ll i1 = 0;i1 < sz(id);i1 ++){
ll i = id[i1];
for (ll j = 0;j < all[type].times;j ++){
a.push_back({all[type].a[i][j],res[i1][j]-'0'});
}
}
// for (auto x:a){
// cout<<x.fi<<' '<<x.se<<endl;
// }
for (auto x:a){
for (ll i = sz(X)-1;i>=0;i--){
if (BIT(x.fi,i)){
if (basis[i].fi){
x.fi^=basis[i].fi;
x.se^=basis[i].se;
}
else{
basis[i] = x;
break;
}
}
}
}
for (ll i = 0;i < sz(X);i ++){
ll mask = MASK(i);
ll ans = 0;
for (ll j = sz(X)-1;j>=0;j--){
if (BIT(mask,j)){
mask^=basis[j].fi;
ans^=basis[j].se;
}
}
X[i] = ans+'0';
}
return X;
}
vector<string> penis(ll c, ll k, ll n, string X) {
init();
vector <string> res(k);
if (n%2==0){
for (ll i = 0;i < n;i += 2){
string tmp(X,i*c,2*c);
vector <string> sus = cv1(0+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
}
else{
for (ll i = 0;i < n-3;i += 2){
string tmp(X,i*c,2*c);
vector <string> sus = cv1(0+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
string tmp(X,(n-3)*c,3*c);
vector <string> sus = cv1(1+(c==3)*2,tmp);
for (ll j = 0;j < k;j ++){
res[j].insert(res[j].end(),sus[j].begin(),sus[j].end());
}
}
return res;
}
string pussy(ll c,ll k,ll n,vector <string> Y,vector <ll> I){
init();
string ans;
if (n % 2 == 0){
for (ll i = 0;i < n;i += 2){
vector <string> res(c);
vector <ll> id(c);
for (ll j = 0;j < c;j ++){
res[j] = Y[j].substr(i,2);
id[j] = I[j];
}
ans += cv2(0+(c==3)*2,res,id);
}
}
else{
return pussy(C,K,N,Y,I);
}
*/
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 30
Accepted
Test #1:
score: 30
Accepted
time: 2ms
memory: 3876kb
input:
3 4 997 0011010101101011001011000101111100100010100100011010011101111011000100110011101111011100011101011100100000011100111011011010010111011100001101010101000101110110011000100001101111100110000101101010110111110010101100110100010011011010010110001110111001000110101010110000101010111011010010101101...
output:
000110100111000110111001001111111100111010011111010101100011010110010011010010011110011000101000111000001000100100101110000110010001101111011111110111110110000011010111011111111101010110111100110110010100111010011110000100010101000010010111101011011011001111110011111111101101010110001100010001010011...
input:
3 4 997 0 1 2 000110100111000110111001001111111100111010011111010101100011010110010011010010011110011000101000111000001000100100101110000110010001101111011111110111110110000011010111011111111101010110111100110110010100111010011110000100010101000010010111101011011011001111110011111111101101010110001...
output:
iunty23v7itdhugh3c001101010110101100101100010111110010001010010001101001110111101100010011001110111101110001110101110010000001110011101101101001011101110000110101010100010111011001100010000110111110011000010110101011011111001010110011010001001101101001011000111011100100011010101011000010101011101101...
result:
ok
Test #2:
score: 30
Accepted
time: 2ms
memory: 3540kb
input:
3 4 997 1111100001010101110011100111000010110010101101100000011110111011111001011000100011010100110000001000111010010111000000000010110100100100001000001101100010110110010111101111110011101011010110110110101111101000011101110110110111011001010100000011110110000000011011010111111001110100001111001011...
output:
110001000100001100111010100001001010010000010110110001011100100101111011010110010001001001100111100111000000110010010100001010111010010101100010100100111011111010100001100100100010011111001101000100011001011101100010100110000000011011010100000010010011101001011001100010000100000110101001011101101010...
input:
3 4 997 0 1 2 110001000100001100111010100001001010010000010110110001011100100101111011010110010001001001100111100111000000110010010100001010111010010101100010100100111011111010100001100100100010011111001101000100011001011101100010100110000000011011010100000010010011101001011001100010000100000110101...
output:
iunty23v7itdhugh3c111110000101010111001110011100001011001010110110000001111011101111100101100010001101010011000000100011101001011100000000001011010010010000100000110110001011011001011110111111001110101101011011011010111110100001110111011011011101100101010000001111011000000001101101011111100111010000...
result:
ok
Test #3:
score: 30
Accepted
time: 2ms
memory: 3824kb
input:
3 4 997 1001110110011100101110011010101011011100000000010000101101100000110000111101001101011010101111000110011101011011100000000011000001000110101101111110100110100010000110101001101011111101110111000011110001011000101010000000000001000101100100000111010110110101000100100110110100001110101110111110...
output:
100111111010110000110000111110110111100000000111110100011010110100001010000001010101010101011111111000001101110010100011110001010000110101000011110101101000101111001000111111110010001000110110010110000100111110011010111001111110111110110101101101100000010111110000110100101100111010010100101100110000...
input:
3 4 997 2 0 1 110110011001000110101111000110000101100000001011101000101011110011011000000010000111001011001011010101110000110010100001011101110000010001000110000010100000011001110111100110010000101100000101001100101011110011010000011110011100001000101010100010100110011011101011001010111110111110011...
output:
iunty23v7itdhugh3c100111011001110010111001101010101101110000000001000010110110000011000011110100110101101010111100011001110101101110000000001100000100011010110111111010011010001000011010100110101111110111011100001111000101100010101000000000000100010110010000011101011011010100010010011011010000111010...
result:
ok
Test #4:
score: 30
Accepted
time: 2ms
memory: 3864kb
input:
3 4 997 1101100101110111011100111100000010000000000010111101111101111011100110101011111001111101010000011110110011010110101111010010001100010111000010111100000111111101011101001110101011010000010110101111101101010110001110101100001111000101001100110000100100110010100011101000000000010011001010000111...
output:
110101111100000011111001101011001100011100110100110111111110000111110111111101110001000010000010010111101111100110010000111111111010111000000110001011111100000110111111101100101100010011011011010110111001101001000111010011110100101100010010011111001111111100010100110100010110110001010111011111100100...
input:
3 4 997 1 3 0 010111000010001001011110110101001011101110001110001101011011001011011010001101000000101100001110110111110101101101000100001111001010000010100000110111101011101101001110111010101001100110000001000110010010101001010100000110110110100000100101100011000101010001011100000100100010011110000...
output:
iunty23v7itdhugh3c110110010111011101110011110000001000000000001011110111110111101110011010101111100111110101000001111011001101011010111101001000110001011100001011110000011111110101110100111010101101000001011010111110110101011000111010110000111100010100110011000010010011001010001110100000000001001100...
result:
ok
Test #5:
score: 30
Accepted
time: 2ms
memory: 3580kb
input:
3 4 997 0110011010100011111110011100111101011000101001100010100001100001001000001001001100101111010111000100101001100101000010010010111111001110111001101001101010000000010000000001001000011000100010101001101101100101001010101111101000100100100010111110110010101101000001000000010101010101010000100111...
output:
011000111111101000000010101111010110010000111110101000000010100010110110111001001100110000010100011100010100000001100001110010111011111011111100000111101011101010111111110001111111010000011010100100100110001110010011010000110110011100010000100110111010100100100010101111010010101010100110100111001000...
input:
3 4 997 3 0 1 101000000011000100110110110101101101001101001001010001000111000001000010100011011000100101010110001101000011000011011010101111001110110010011000100010110101010111010001100110010010000000011011101101111000100000000010111010010011101000011011010100000110001111100111010010101110001101101...
output:
iunty23v7itdhugh3c011001101010001111111001110011110101100010100110001010000110000100100000100100110010111101011100010010100110010100001001001011111100111011100110100110101000000001000000000100100001100010001010100110110110010100101010111110100010010010001011111011001010110100000100000001010101010101...
result:
ok
Test #6:
score: 30
Accepted
time: 2ms
memory: 3632kb
input:
3 4 997 0110100001110010011011101101010011110000010111100111001100001110011111010110000010000000010001101111100001001011010001101011111111110001100100111000111110010111000111000111101001110100111000101011010110000000111010011011000000010111000000111111011101011101110101101001101000101001111000111100...
output:
010000101100000101111111010000001100100010110001101101010110011010010010100001001111110110101010111001110101100100110100110000111110000010000111111011001001111000001010010110000110011001101001101001101100010110100100110111001101110000000110111111011000001011100011110100001110010101011011100001110001...
input:
3 4 997 2 1 0 101101100111011000000101000001101000011011111011110100001011111001001101000100110101111010101111110101100001011100011000110100001000110011000001101011011100100011001001110001000110011101011110010001010011100110011110110000000010001100111001000111001101100010110001111001101000100010010...
output:
iunty23v7itdhugh3c011010000111001001101110110101001111000001011110011100110000111001111101011000001000000001000110111110000100101101000110101111111111000110010011100011111001011100011100011110100111010011100010101101011000000011101001101100000001011100000011111101110101110111010110100110100010100111...
result:
ok
Test #7:
score: 30
Accepted
time: 2ms
memory: 3856kb
input:
3 4 997 1100011010001011010001111001111011111011110001001100101101100101110011010110001001110001111000110011000111011100011100101110010001010111011111010011000000000101000100100100001100001011011010100110010011111100101100111110100100001010110000000101011111111011000011010001111110110100011111110000...
output:
111010001010100011110100011000100001111111000111000001010111101001001111110110000111100000110111001010010000101101101100010011101010011001111111101111110110110011001000000101011000000100001110111101000011010000000000011001101101000001100000011000000001111010011000011111110110011111101110111011011010...
input:
3 4 997 2 3 1 010001111111110010101101001111110001011001010101000000100000011001111011100011000111000111110111110001101111110110000110110100011100011001010110110111000001100011111011010111011100111111111111000001010000001000101011001111101111101101000000000001101011110111111111110100011011001111110...
output:
iunty23v7itdhugh3c110001101000101101000111100111101111101111000100110010110110010111001101011000100111000111100011001100011101110001110010111001000101011101111101001100000000010100010010010000110000101101101010011001001111110010110011111010010000101011000000010101111111101100001101000111111011010001...
result:
ok
Test #8:
score: 30
Accepted
time: 2ms
memory: 3592kb
input:
3 4 997 0110101110010011001000010000111010101011000110001011101010100110010100001100011101100111100010110000010010000100111001100001100011000000110110001000101011000111110000001000110010010010001111111110111111111010001010100110011011100011011011001011101010100110111001101100111110110011011011000100...
output:
011100100010100110100101111101000000011000000001101001001000001111111010011000101010011011110010011101100111001101101111111001001011111000000010010110001110100111110011011001010101100010000111010111101100101011110111000010100010011100111011100010111000100001010001100101011010101011010100110110100000...
input:
3 4 997 2 0 3 100100011110000010100100011010110100111010001100100011001101001111110010011001001010111011110100100110000000110111000111001001011001111001010100000110100000110111111000000001001010111001000110010001110101000110110101111101010101010110111000000000000110001100110000101000011100111001001...
output:
iunty23v7itdhugh3c011010111001001100100001000011101010101100011000101110101010011001010000110001110110011110001011000001001000010011100110000110001100000011011000100010101100011111000000100011001001001000111111111011111111101000101010011001101110001101101100101110101010011011100110110011111011001101...
result:
ok
Test #9:
score: 30
Accepted
time: 2ms
memory: 3636kb
input:
3 4 997 1010101010001000001101010111110011101100010111000111100010010110110101011110100010100001111000000010001110101000000100100011111100000100010111111101001111010100101110101001101000101001010100110011001001111000100000010101110010001000001101101011110110111110110111100010011111001011000001100100...
output:
101010110100110101000101110000100011100100110101111101111010100100101000010010111001110100111000011001000110011001110001111000100100011011011110100000000001101000000101101110110001010100000111100110000101000111111110000110100011011010010101100010000000101101001100110110101111010101111011100001011110...
input:
3 4 997 3 0 2 100010110101101000110001110010101011101100110001100111110100101011000001111010001000100011000111101111110111101001001100000010011000001011110000110101110111110011100011010011101110001011010010111110101010110000001101110110011000001010010100101101000110001100010011001101010000011011001...
output:
iunty23v7itdhugh3c101010101000100000110101011111001110110001011100011110001001011011010101111010001010000111100000001000111010100000010010001111110000010001011111110100111101010010111010100110100010100101010011001100100111100010000001010111001000100000110110101111011011111011011110001001111100101100...
result:
ok
Test #10:
score: 30
Accepted
time: 2ms
memory: 3588kb
input:
3 4 997 0001010010010000101001001110010010101001110010111001111111011101101111000001101100111110110000101000000001100001010001110111111100000110111011000011010101111001001110000100100000101001100010101110001101010001011101000011000000001010010111011101101001010000110100111110010100110111100010101101...
output:
000000101100100010111111001111001000000001110110000110110100100011110011000010011110000111010100111011110100111000010101110010101101001001101110000010000100110101100001100111110010101110011000100011111100001001101101011111011110001100101111001100001111100111001011010110001000101111110011010110101100...
input:
3 4 997 2 3 0 010110000110111111011000101111100010011111001100011100001010101000010100000001011001111101111010000010111001001101110111000111011011001110010101001111111111100111010100111010011010011011010001101111111000101000100011100111101010000101101001011001101111011001110101101001101001101100111...
output:
iunty23v7itdhugh3c000101001001000010100100111001001010100111001011100111111101110110111100000110110011111011000010100000000110000101000111011111110000011011101100001101010111100100111000010010000010100110001010111000110101000101110100001100000000101001011101110110100101000011010011111001010011011110...
result:
ok
Test #11:
score: 30
Accepted
time: 2ms
memory: 3860kb
input:
3 4 997 0100110100101010101000001010101110001110001000000101000011011101110110101011110010000111101011111011101000101111010011100111010100110000110101111110100101101011100111000011000111100100111010000000110101010111101111001100100100110001110001101001101010100101000100111100100111010110100100011110...
output:
010110101011111001001101100001101010110001010001110110010001011000010111110100001010010111010101111010100110011110100010101110110111010101011111000100000010110110100100001110001101111110001011011010101110110011011110100011000110100111000001000001011011111010000001010000000001110010110111101000111101...
input:
3 4 997 2 0 3 111010001000000000011110110010111010011001111111101010000010110011011000101111101010001110011001011100100100001000000110001000110110110110100110111010001100111101110100111100111011101010101001001000001011101011101001001101001111011110000111001111010110101101101001000110001111101100001...
output:
iunty23v7itdhugh3c010011010010101010100000101010111000111000100000010100001101110111011010101111001000011110101111101110100010111101001110011101010011000011010111111010010110101110011100001100011110010011101000000011010101011110111100110010010011000111000110100110101010010100010011110010011101011010...
result:
ok
Test #12:
score: 30
Accepted
time: 2ms
memory: 3648kb
input:
3 4 997 0001011101010010101010110110111100100111101010101001000100010100011011111001101011001110101100111111000010100010011100010110010111101011001110011101011001101111010100010010110110001111001000010011011011101100011101100110111000100001011110011001100011111110111011110010110011101000001000010000...
output:
001100100111011010010110101011111100001101011011111011010001111000101111011000111000111000001010001010011110100111111000001101011001111011101000110010001101101110011100010110011010101100000011100010101000101001110100101010100100001000010110110111000001011100110111001001110010100101001110100110100100...
input:
3 4 997 3 2 0 001100110001001011000010010111000000111010000100110101000111001110111000000000000100101001011011001110101110110010111110111111100110011110010001110110101000110001110110001111101110101100110010010110000110011100010101011101011111101000010100000100100011001110100001101110001101110110111...
output:
iunty23v7itdhugh3c000101110101001010101011011011110010011110101010100100010001010001101111100110101100111010110011111100001010001001110001011001011110101100111001110101100110111101010001001011011000111100100001001101101110110001110110011011100010000101111001100110001111111011101111001011001110100000...
result:
ok
Test #13:
score: 30
Accepted
time: 2ms
memory: 3872kb
input:
3 4 997 0100001101100101100011010011101001110110010001101001000010001110001011001011110111010111000000001000011010110101001011111100010111011100000000001011110010101000000110010001001110111011001011001101010001010001001111110111110100100000011000001111001111110011111100110111100101010101010010100011...
output:
011101000010010010001110100101001010011011011100100010010011101011000011010100101111001101010100000000101001100111000100001100010101101110001100011100111000010100111011011011000110101000110101101100101011110011100111001101001101001111110101100001000110100011001101100010110101000010000110100110101110...
input:
3 4 997 3 2 1 010010100100101111100101101110001111001010111100100010100110010111000111011101100011000000010100010000000110010111010110101100000110001001010010000010110100010101100010101100010101001001011100100110100111001101101101000000111110111101010001001100101010011010111010010000101001010100001...
output:
iunty23v7itdhugh3c010000110110010110001101001110100111011001000110100100001000111000101100101111011101011100000000100001101011010100101111110001011101110000000000101111001010100000011001000100111011101100101100110101000101000100111111011111010010000001100000111100111111001111110011011110010101010101...
result:
ok
Test #14:
score: 30
Accepted
time: 2ms
memory: 3572kb
input:
3 4 997 0011010111000101010101000111000101111000010101010100011001010110001001101010110100110110001010001001100010001110011111111000111101001000010010100101001101111001111001101100010000011101000011100010011000111110001101011011011001100111111100111101001011100010011000101010100110100111010000000000...
output:
000101010101100101100110100101101000111110111000011110101100110000101111101001111110001010010100000110110000001100111001101110100100111110000101110110001100001100101110000101001100000101000000000110000001111111111001100100100100101100001101011011111111110110011111001011111101010101100111100011110011...
input:
3 4 997 0 2 1 000101010101100101100110100101101000111110111000011110101100110000101111101001111110001010010100000110110000001100111001101110100100111110000101110110001100001100101110000101001100000101000000000110000001111111111001100100100100101100001101011011111111110110011111001011111101010101100...
output:
iunty23v7itdhugh3c001101011100010101010100011100010111100001010101010001100101011000100110101011010011011000101000100110001000111001111111100011110100100001001010010100110111100111100110110001000001110100001110001001100011111000110101101101100110011111110011110100101110001001100010101010011010011101...
result:
ok
Test #15:
score: 30
Accepted
time: 2ms
memory: 3648kb
input:
3 4 997 1010101011101110011011110110000110011010001001001100111100011100010100100100010100011100001111111110011011110001010100100010001100110101100100100010100110011011101100111001010000110100000011111110100011000101101111110011001110001000010010111110001110000101011101111010100101011011000011101100...
output:
101011100101101011111101010111111110000100110101000110111000010011000111001110001111011110011000111000101010001100111111110001110101100111011110011111101010101001110010101000001010011001000010100011101010101010111100010100100001111101111010010101011000111100000101011111010101100000011101000110111011...
input:
3 4 997 1 2 3 101110111010100100000000000000111011010010000100101011000100001110110111111000101010010110011111000100111100001000101111000001100001100010000000100000100000111000100011100000000100011101101101100011110000000100010111001110010001001011000111011010011111111101000000001110101010101101011...
output:
iunty23v7itdhugh3c101010101110111001101111011000011001101000100100110011110001110001010010010001010001110000111111111001101111000101010010001000110011010110010010001010011001101110110011100101000011010000001111111010001100010110111111001100111000100001001011111000111000010101110111101010010101101100...
result:
ok
Test #16:
score: 30
Accepted
time: 2ms
memory: 3600kb
input:
3 4 997 1000100101101000001110111001101010100001000101001110111100111101111000101110110001111011010110100010001000001010101111010111101111110101100111100011010001011111101001110001110000100101100111101010110001001000101100100000001011000010001010111000101000100110101011101011001000010101000100100101...
output:
100110111010000111111110110010010010101101110101000011100000010110001011001000101010011010100101011111101110100101001011011011111100101000110011010001001001010111010100111010110100101000100111011000001001101101011101110010010001000101110101111100111000111111010111110110011100010011101000111000010110...
input:
3 4 997 2 0 1 101000111010000011111110111101100000100110111010010110111110101011001010000000111010101000010010001101011001100001111110000010100010011001100100010110001011001111101101011011001100100011011111110111100110100101101111001101111110011000101010000111110010100100101011001000010011000110111...
output:
iunty23v7itdhugh3c100010010110100000111011100110101010000100010100111011110011110111100010111011000111101101011010001000100000101010111101011110111111010110011110001101000101111110100111000111000010010110011110101011000100100010110010000000101100001000101011100010100010011010101110101100100001010100...
result:
ok
Subtask #2:
score: 25
Accepted
Test #17:
score: 25
Accepted
time: 2ms
memory: 3584kb
input:
2 4 998 1000110101101001111010101101100101011111011111110001101110110001010100000011001110011111100010010001111100001111001111100100110011100000100010100101001001000001010010110010010110111000001001100110011110101010100101000010110100100110001011000100011111011010101100010001110110010110101111011011...
output:
101101101110111001110111001010000100000010111010001100110011011111001010010001000110000110100001010110101001001100010011010111101000001110011011101000010011101100011100000011101010000001101111001000010111110010010101100001100011100011011001011010001000101100011001001001101101110011011000100100001100...
input:
2 4 998 0 1 10110110111011100111011100101000010000001011101000110011001101111100101001000100011000011010000101011010100100110001001101011110100000111001101110100001001110110001110000001110101000000110111100100001011111001001010110000110001110001101100101101000100010110001100100100110110111001101100...
output:
iunty23v7itdhugh3c100011010110100111101010110110010101111101111111000110111011000101010000001100111001111110001001000111110000111100111110010011001110000010001010010100100100000101001011001001011011100000100110011001111010101010010100001011010010011000101100010001111101101010110001000111011001011010...
result:
ok
Test #18:
score: 25
Accepted
time: 2ms
memory: 3572kb
input:
2 4 998 0001000010111001011001110111011101101001100100000110100100111011101101111010100100100000011010001111110111111010111001011111100010000100110011001111001011011110100111010101111000010111001101010100101011101001110111110001011010001000011000010001111101100010111011100100011000100010001111011111...
output:
000010100101010101101000011000101001101000000110111111101101111010011111110011111011011100010001011011101111000110100100001101001111010100000011111000110101101010111100111001000010011000011100100000000001001000010110011000001001111110101001111001011001000011110110110011001110111101111001000010000011...
input:
2 4 998 2 1 01000111111010101111110011111101011000111000111000100000010000101001111100101001111000010110110001000111100001111010110101001110010101111010111000000111100001010111111110100100111001001001011001110001100011101010111100000110001010001100011100101101100110111001111101010100010011110110110...
output:
iunty23v7itdhugh3c000100001011100101100111011101110110100110010000011010010011101110110111101010010010000001101000111111011111101011100101111110001000010011001100111100101101111010011101010111100001011100110101010010101110100111011111000101101000100001100001000111110110001011101110010001100010001000...
result:
ok
Test #19:
score: 25
Accepted
time: 2ms
memory: 3588kb
input:
2 4 998 1001110011001010100001100111001111111011110101001000001100000010001000001011011001110111100001010010111100000100111111111001001011100000001101010110100111100110010000011101001111110100110111110010110011111010000010011100100100001100011111000101110110111001011100010010011010101000001100000111...
output:
101111101001010011101101100000000000100101011001001100011111100011000001011011010100110011011111001111100010111000110111011110100100000110100000010010000101110011111100101101100010010000111110011111000100001111000011010001011001000001111110011000011010001011001000011100110001000100000101010110000110...
input:
2 4 998 2 3 11111100101110110001100110110010100001111010100010000001000011100100110011110111010110110001100010110000001111110011101100100111100110110010110010110111110111101100100111100111101001001010100011100011001011010110010011001110010011010001011001100110101110100101001010010111001011010101011...
output:
iunty23v7itdhugh3c100111001100101010000110011100111111101111010100100000110000001000100000101101100111011110000101001011110000010011111111100100101110000000110101011010011110011001000001110100111111010011011111001011001111101000001001110010010000110001111100010111011011100101110001001001101010100000...
result:
ok
Test #20:
score: 25
Accepted
time: 0ms
memory: 3572kb
input:
2 4 998 1101000100100000000001111110000001100100010010001011011111010001100101100000111010110111110110111001100010111001101010101110110111100001100011111000001100111100001010001101100000111000111001110011101000100100010001111101001010101000010001000001101001100010110001000000101001110111001101111011...
output:
110000000001110001010110100111001001001110011110101010101010111111001011100000110010111000101101001000010101110010100101001001001101001001010001100101010101100111101101001001000011011100010011111001001111111111010110000001111000101110001110101101011101010000101010011101011000111110001011100010101100...
input:
2 4 998 0 3 11000000000111000101011010011100100100111001111010101010101011111100101110000011001011100010110100100001010111001010010100100100110100100101000110010101010110011110110100100100001101110001001111100100111111111101011000000111100010111000111010110101110101000010101001110101100011111000101...
output:
iunty23v7itdhugh3c110100010010000000000111111000000110010001001000101101111101000110010110000011101011011111011011100110001011100110101010111011011110000110001111100000110011110000101000110110000011100011100111001110100010010001000111110100101010100001000100000110100110001011000100000010100111011100...
result:
ok
Test #21:
score: 25
Accepted
time: 0ms
memory: 3592kb
input:
2 4 998 0111000110011000001100100101011010101111101001111001101011001100111001110100111110100101010000111010110001110000010011100110000100000101111000010111011111100011000010001110100100111101110000100100010110011111011001111000100011010101101001011001011101001111011001001010010001111000000101010100...
output:
010010100000010110111001101011111101011110010100101101000111010000011100010111000010111000111100010110110101101011011001100101110101100101100001010100001000001100111111110010001000000111010100101100001010100101110000001010101000111100000100000101000111101001100111100100100101100110010111111111011110...
input:
2 4 998 0 1 01001010000001011011100110101111110101111001010010110100011101000001110001011100001011100011110001011011010110101101100110010111010110010110000101010000100000110011111111001000100000011101010010110000101010010111000000101010100011110000010000010100011110100110011110010010010110011001011...
output:
iunty23v7itdhugh3c011100011001100000110010010101101010111110100111100110101100110011100111010011111010010101000011101011000111000001001110011000010000010111100001011101111110001100001000111010010011110111000010010001011001111101100111100010001101010110100101100101110100111101100100101001000111100000...
result:
ok
Test #22:
score: 25
Accepted
time: 2ms
memory: 3872kb
input:
2 4 998 1101100100011100110000110000011101110101000001000011110111010010110111101110011000100101011011101000000010001011110001111001100100001100101100011101011000110111000001100111100111111110110111011110111110100001100110100000101000110000111111100001110000000011000001001110111010110110001100001110...
output:
111000111100000101010001001111001111110100010111100010101101101000111000110100010001011011111111111110001010001000001111001100000001111110010000111111010111110011011000010110000000100011111001110100100011000111101011001110000000010011101100110100010001100001100010001101101100100001100111101010100001...
input:
2 4 998 1 2 01010100001100111101000011010110011010101001101000000011001101010000110101101111001011011110010110111001011000101100111001000011000010101110110010110011101100010100110111010011101101100011000100011010110100001011011100000100001001000001100101011110111110000111000011100011000101000001100...
output:
iunty23v7itdhugh3c110110010001110011000011000001110111010100000100001111011101001011011110111001100010010101101110100000001000101111000111100110010000110010110001110101100011011100000110011110011111111011011101111011111010000110011010000010100011000011111110000111000000001100000100111011101011011000...
result:
ok
Test #23:
score: 25
Accepted
time: 2ms
memory: 3576kb
input:
2 4 998 0101001010011000010001001000011111001110110001101010100100110101110101011011110000100111101100111000001000101101101111101110011110110010110010111110010000011111010110110010010001111011100011001100110101000001110111100000011111001111000111100001111110011110100001110110010011100011110010101100...
output:
010010100101100111111101101000011101101100011000100000111011110110001110110100110110000101101011111101001111000111110011001110111001010111001110110011101100001001001000111110010010011111001110101110101100111110011100000111011100001010110001110001001010010001111111111001100001110111110110000101011101...
input:
2 4 998 1 3 01100100000000110010001010011101010111001011111100101001111010111110001110000111011110001111000000010001011000110011011001110110001110001011001000101111010011100100000011100001111101111111000000011101010001110000101001011011001011000010110111110111110010110111101111111100000100101101100...
output:
iunty23v7itdhugh3c010100101001100001000100100001111100111011000110101010010011010111010101101111000010011110110011100000100010110110111110111001111011001011001011111001000001111101011011001001000111101110001100110011010100000111011110000001111100111100011110000111111001111010000111011001001110001111...
result:
ok
Test #24:
score: 25
Accepted
time: 2ms
memory: 3832kb
input:
2 4 998 0010110000000110101011100110110010100111000100000111101100101110010101001010111101111011100111111110011101001101000111011111111001011010001011001111111110100001100110010010010111010111111001000011011101100100000011000000010001111100000110011011000010110100010101011100010110010000011101111101...
output:
001100011011011110010000011000110101101101101011110101110011111101100011111110001010000111011101000101010011000101110010100010010101110110000101110000011101000101101010110010111100110001001010000000000110100011001110010100111110000010110111000000111110100001000111110111111110110110001111011001110110...
input:
2 4 998 0 3 00110001101101111001000001100011010110110110101111010111001111110110001111111000101000011101110100010101001100010111001010001001010111011000010111000001110100010110101011001011110011000100101000000000011010001100111001010011111000001011011100000011111010000100011111011111111011011000111...
output:
iunty23v7itdhugh3c001011000000011010101110011011001010011100010000011110110010111001010100101011110111101110011111111001110100110100011101111111100101101000101100111111111010000110011001001001011101011111100100001101110110010000001100000001000111110000011001101100001011010001010101110001011001000001...
result:
ok
Test #25:
score: 25
Accepted
time: 0ms
memory: 3572kb
input:
2 4 998 0100011010100000100111100110001011001011101010111110110110110111010110001110001111110010111011000010000110110111010000111011000000110111000100010100101110000101101101111111111100010010001010111101110111011010101110010000101110100111111001110001000000000000011101100010010010011100000011100011...
output:
010110001011010011101010111110010110110011001111000010010100100000010000011010011001111100000010111111101010001010011101000000000101000110110011001111000100000101101001100010000010101001100111011000110010111010110001000101011001111111001010100010101000110101001011001011101101111111000110000101001110...
input:
2 4 998 1 2 00101000011010100011101110011111010010111110100010011111001111001111010100110001111111110110101101010110110100111011101101000000111010000100001011110011111100101100111101010001100110010101010101111100111110000011011010010111000100101010001100011010010100000011001010011100101110001000100...
output:
iunty23v7itdhugh3c010001101010000010011110011000101100101110101011111011011011011101011000111000111111001011101100001000011011011101000011101100000011011100010001010010111000010110110111111111110001001000101011110111011101101010111001000010111010011111100111000100000000000001110110001001001001110000...
result:
ok
Test #26:
score: 25
Accepted
time: 2ms
memory: 3628kb
input:
2 4 998 1001010100111000100101111111100000011000100110000001110001011111101111001110101000010110000100010111000101011000011100101110000001110010001100000011000110011011101001011000100001101110101111010101000111000001010110101011011100011010100101100001011001110100111110110101111011101011011110011100...
output:
100100101001111000101010001101111011111000010000010001100100110001000000000010101001101001111011010011000110100100101001000101011110011111100110110000101110001000111010101000110010001101001111110011110101100101110010011011010000000010000001111101100111100011010100100111000010110110101010001001000001...
input:
2 4 998 1 0 01011100011111000100010001000111110010100110010111010100111010001110110011010111100100001010110101010001011011110110011001101100111101101011110100011101100011000101000000111001001110011101000101011101000000110110001101101010001000001001000001100111111101111011000010111100101000010100101...
output:
iunty23v7itdhugh3c100101010011100010010111111110000001100010011000000111000101111110111100111010100001011000010001011100010101100001110010111000000111001000110000001100011001101110100101100010000110111010111101010100011100000101011010101101110001101010010110000101100111010011111011010111101110101101...
result:
ok
Test #27:
score: 25
Accepted
time: 2ms
memory: 3656kb
input:
2 4 998 0011001101010001110111010101011111110011001100000000010101010110101100010110000110101101011111010100001001001000101100010001010111111111100000011011110101101101110100110101011000001010011100000111011001010001101011010101001100011000001011010111110111000001100111110000000010100000011111110101...
output:
000001001111010111000000000101011000010010110111010001101000000111111000101101111100010100100100010101001011010000100011011111001011000010000111010101010101011010000011000000100001010111111110110001011000111010001100001010010110000111010111001101001011111100001011000101000110001010010000111011101011...
input:
2 4 998 1 2 11110101010101111111110000010110110110011001110100100000110101011111000111011001011101100010110011100101100101110100100111010001011100001000111101110101011011110110110110000001101000111100111100000100000001001111111011100111111011010110111101110111100001101000111000001010010011111000001...
output:
iunty23v7itdhugh3c001100110101000111011101010101111111001100110000000001010101011010110001011000011010110101111101010000100100100010110001000101011111111110000001101111010110110111010011010101100000101001110000011101100101000110101101010100110001100000101101011111011100000110011111000000001010000001...
result:
ok
Test #28:
score: 25
Accepted
time: 2ms
memory: 3640kb
input:
2 4 998 1110010011101001101110001110111110010111000100010010100100110000000011101000010001100111001101110001010011001100110011000000010111001011000010100001110110111110100100111100000100111111010011001101010101111001110000111101111110100111000111000011100001011110111010001111111010110001000101100011...
output:
110111101010111110010000001000000011100101010001000111111111000111100010001110111000110000110111110101101100111110010011001001111110111110000001001111101010100000010110111011110001101101100000101000100100010010011000001001000000011111101010111101101011101100100110001110010000100111101011011011101000...
input:
2 4 998 3 2 10111011001010111101010111111000001010110001100101110101010100100100000101000010111001011011110100100111011000110101010110101010101011100001010010110101010110000011001110101010000000110000011001001000100101111011111000110001011110101001010001101110010111001011101101001101101111001110110...
output:
iunty23v7itdhugh3c111001001110100110111000111011111001011100010001001010010011000000001110100001000110011100110111000101001100110011001100000001011100101100001010000111011011111010010011110000010011111101001100110101010111100111000011110111111010011100011100001110000101111011101000111111101011000100...
result:
ok
Test #29:
score: 25
Accepted
time: 2ms
memory: 3636kb
input:
2 4 998 1011100001101001110011011001100111100001100010110111001101110001100000001101110110011111110111101000111110110010101010111000110100010010101000111001001110011100111110111001110001100001101011100110001010101101011111110111101000010110010110100000101111010011101101001001010001101010001000100000...
output:
101001101111101011001010010001001000111110111111101110001010101100001000100010111110101101001011010010110111011000010110001011001001100101100000001011100011101100011110010100110010110001011101001000100111110111001100010100101000101000010010000101110011001000101100010010100100001100110001000000000111...
input:
2 4 998 3 1 00100011010011111001100001100101100000001111001010110011010010000111011011101101110011010001011000110100011101010100100100000010001111110001111100001011011110110000111000111000101000000100001101011000110010101001010111111101111111101010010010100010110100100101100100100001010100001010101...
output:
iunty23v7itdhugh3c101110000110100111001101100110011110000110001011011100110111000110000000110111011001111111011110100011111011001010101011100011010001001010100011100100111001110011111011100111000110000110101110011000101010110101111111011110100001011001011010000010111101001110110100100101000110101000...
result:
ok
Test #30:
score: 25
Accepted
time: 2ms
memory: 3644kb
input:
2 4 998 1010111110110101110011101100001110101101111011001110011111011101010011000110101101000010110011110111011000011000110011011010111010010010111011001101001000000000001100001111010011000011101011001100100011111100001010101000101110010000101101100001100101101111010111011010111101111101000100010011...
output:
101110011111110010111111110111110111011001001111010100101111101110001111110000000000110111001011111011110010101010001001001001110111101101110000000010101010011000101101110001101111101101010010001110111101001111111100110000001110001110101000000111100110101010010101011111011001000010010110100011111100...
input:
2 4 998 2 0 00000100110111110010011101101010011111010110110010110110111000011110011110100000110000011111001111100011100010011100011101111100001000001010010111010101010111010000000011100100000001001010001101101011100000101010101111011011101010100110010010101101010010001110101110110001011100111111010...
output:
iunty23v7itdhugh3c101011111011010111001110110000111010110111101100111001111101110101001100011010110100001011001111011101100001100011001101101011101001001011101100110100100000000000110000111101001100001110101100110010001111110000101010100010111001000010110110000110010110111101011101101011110111110100...
result:
ok
Test #31:
score: 25
Accepted
time: 2ms
memory: 3588kb
input:
2 4 998 1111011100000111001010011011100111000110101010110011100010001011100000000111100111010100111101110010111010101000011010110100110110111111011100010111010010111111011110010111100000101001001010110101100010011010101111001100101101100110101010100110110011100110110011011000101011010101001111000111...
output:
110100010010101011011010001010101000011011011101001110100110011110110100010110110110011000100010011010101011111001011010011111011111101011010011011000110000001101110101100011000000101000111011110100001101100001101100010110111110110101000011001000110111111111101000101010000111001111011010101010010001...
input:
2 4 998 1 2 11110011100111010010101111000011000011010100111110101000101100011111110111001111110111001001101101000110110000111010101010001010000100100101110011000101111110111110111011100000100000110101011010010001000101011101110011100011100011101101101001000000111010001100010100000010000010111111111...
output:
iunty23v7itdhugh3c111101110000011100101001101110011100011010101011001110001000101110000000011110011101010011110111001011101010100001101011010011011011111101110001011101001011111101111001011110000010100100101011010110001001101010111100110010110110011010101010011011001110011011001101100010101101010100...
result:
ok
Test #32:
score: 25
Accepted
time: 2ms
memory: 3864kb
input:
2 4 998 0101111101110111010110101011011001101001100011010100101010001000110101100000001100111100000001111100100010110101101101101010100101000101101010110111010010100101111101011010101110000111111000011110101100110101001010011011000010100111111111000110011000010110101000010011101100010000001111000111...
output:
011101010110100101101011011010101101000000110001111010011001101001011010010110011101101010011100111000010010100010011111010100011000001000000011010010000110101111101000010101001010011010100011011000000111001010010010010010000001000001110111001111101010001100001110010111111000100111101101111101111111...
input:
2 4 998 0 3 01110101011010010110101101101010110100000011000111101001100110100101101001011001110110101001110011100001001010001001111101010001100000100000001101001000011010111110100001010100101001101010001101100000011100101001001001001000000100000111011100111110101000110000111001011111100010011110110...
output:
iunty23v7itdhugh3c010111110111011101011010101101100110100110001101010010101000100011010110000000110011110000000111110010001011010110110110101010010100010110101011011101001010010111110101101010111000011111100001111010110011010100101001101100001010011111111100011001100001011010100001001110110001000000...
result:
ok
Subtask #3:
score: 20
Accepted
Test #33:
score: 20
Accepted
time: 2ms
memory: 3636kb
input:
2 4 997 1000111101100000111001101001001101111101000100111100010101001010000011001110101111010111111001111000010001111010001011111101101010100011101100001000000000100110000000011110101111100000111000011000011000111110011101000000011000110001001111000100110101001101111000101000101001001010001101011000...
output:
101101001101100001110000110101100011111011011101100101100011111010001000100000010000111011001100100100110101000100000011011101111100101001100001101001111111101001111010110000010001101001010110001001011101001001000101011100111001100010111100011101000001101000010010001110000001110111101011000101000101...
input:
2 4 997 3 0 10110000100011100100011001101101000110000001100110110101111100010110000010001100000110001000100110001010011100001001100111001100101110011101101010010000101100101111000110010100110010110111111110100111110110100000100101111000001010001001110001010111110111001010010010011110100100000010011...
output:
iunty23v7itdhugh3c100011110110000011100110100100110111110100010011110001010100101000001100111010111101011111100111100001000111101000101111110110101010001110110000100000000010011000000001111010111110000011100001100001100011111001110100000001100011000100111100010011010100110111100010100010100100101000...
result:
ok
Test #34:
score: 20
Accepted
time: 2ms
memory: 3828kb
input:
2 4 997 0111011000100010100011000000000111011100111011000010100011000100101011001110011111110100100101011111001001011011011001001100111101010101000001110011010101100101111000001001101010000100110011100001101001111011000101001110001001010000100111011011001010010011101001010101011100011110011000111101...
output:
010100001011000011111111001011011011110111011001110001100101111101010001000101011100101010011111001001100001110001001011100010001001010100110100110100000011011101011101011100111011111001111110011100010101000011000100000100100011000000111101100000101101000000001111011011000110101100100100000100100011...
input:
2 4 997 3 2 01001111100100010001100111100111010110011111111011111000001101111010000110100010100011011011011001010100011110111000110000111110011010010110001000110011110101011000001100011110011010010111101000111110010011010110001111110000100110001001010010100110001101101000110110010101000011100100111...
output:
iunty23v7itdhugh3c011101100010001010001100000000011101110011101100001010001100010010101100111001111111010010010101111100100101101101100100110011110101010100000111001101010110010111100000100110101000010011001110000110100111101100010100111000100101000010011101101100101001001110100101010101110001111001...
result:
ok
Test #35:
score: 20
Accepted
time: 2ms
memory: 3580kb
input:
2 4 997 0110101110110010111001101011001010010100001110010100110011110101000001001111011100010010111110001101011010011100000010100011011011001000000000100101101110110000000011101001011110101001100101100101001100111100111000011000000100000111001110100001100101010111011111100010111011010110111100110011...
output:
011010001101100010010010011111010001110100001110110110110010000111100000011010000011100110101001010000111100100000010010001001010111001111011100001010000110000101101001101100101001100011001110100011010001000001111000100100110001010110100001001010001110000100000111111100000011000100110010000111000001...
input:
2 4 997 1 2 10111110101011100100110100001101000011110110110001100100001011100000001001111100001001111001011001111100100100010011111001010111111010100110111111111110110000111100110001111011011000101011000000011001001101011000101011011011111001110011010101100000011011110101000111100000101011100100000...
output:
iunty23v7itdhugh3c011010111011001011100110101100101001010000111001010011001111010100000100111101110001001011111000110101101001110000001010001101101100100000000010010110111011000000001110100101111010100110010110010100110011110011100001100000010000011100111010000110010101011101111110001011101101011011...
result:
ok
Test #36:
score: 20
Accepted
time: 0ms
memory: 3592kb
input:
2 4 997 1101111111010010000111101101000111110010000000000000010110011000010111001111011001011100110101011100011110010001100100100010000111101101011110100100011011111101000000101101101000111101100110110100111011101000101000000000110111000100000100010010101001101010001011110011000001111100010001110100...
output:
111111000011110011000000000110100111110101111101110110001000000011110110010111110000111000111010011111101000001111010000001001100011000001110101010011110000011000100101000101101001010000000100100000111000111100111001011010101000011010001010101100111011111100110100100000110100000101111101111100110100...
input:
2 4 997 0 3 11111100001111001100000000011010011111010111110111011000100000001111011001011111000011100011101001111110100000111101000000100110001100000111010101001111000001100010010100010110100101000000010010000011100011110011100101101010100001101000101010110011101111110011010010000011010000010111110...
output:
iunty23v7itdhugh3c110111111101001000011110110100011111001000000000000001011001100001011100111101100101110011010101110001111001000110010010001000011110110101111010010001101111110100000010110110100011110110011011010011101110100010100000000011011100010000010001001010100110101000101111001100000111110001...
result:
ok
Test #37:
score: 20
Accepted
time: 2ms
memory: 3828kb
input:
2 4 997 1101101000100010111011100011011001111111001110011010111011110010100010110111100100010111011100110011001011011001110111101110100101100010101111010011110010010001000101000011001000101110001100011000100110000001100010101001010010001110011100100000100010001100101010101011010000100111110001111011...
output:
111000001111000101110010101111001010011000010100000011101111111001001011001110000001000000110000101010001010100110110100001010111010100100011101100111011101110100111111010110001101011010000100110011100100000000000111100100011110101001111100110100001001111111010011101100110011011010110111010000000101...
input:
2 4 997 1 2 01101010101011101111110110101110001111010111111111100101011010011010110111000101010011101010110100010001001001000010111000000000101011001011001111001000101010101111110001111100001101011100111111101010011011010000010010001001101001011110000111100001000111011001101111001110010101001011110...
output:
iunty23v7itdhugh3c110110100010001011101110001101100111111100111001101011101111001010001011011110010001011101110011001100101101100111011110111010010110001010111101001111001001000100010100001100100010111000110001100010011000000110001010100101001000111001110010000010001000110010101010101101000010011111...
result:
ok
Test #38:
score: 20
Accepted
time: 0ms
memory: 3580kb
input:
2 4 997 0000000011011010010000111011010010000111100000000101010101101000010111000111110110001010010010000010100000100010100111001000111011111101000110111100001110111000111110100110010100101100000011000011100011010001100110101000000111000111101011100000010001011101101100010110001111001000000110100000...
output:
000011100100100110011000010101100111011110100110001000001011101111110010110010101110010100110011001011001010100011011011000101111000010011100010000011010011100100111010000011111111110101000101100001110011111001010010100000111111001100011010001001100110011000010000110110101100101000011111110111111000...
input:
2 4 997 3 2 00000001111000111001100010100010100101001001111011101111110110101100010001100010110100101101000110100001110110010101011000111000000100100110010100011101001101011110110011111110000000001010101111000111000011110111100000100001101100010010010111101101001110011000010111111110010110010101100...
output:
iunty23v7itdhugh3c000000001101101001000011101101001000011110000000010101010110100001011100011111011000101001001000001010000010001010011100100011101111110100011011110000111011100011111010011001010010110000001100001110001101000110011010100000011100011110101110000001000101110110110001011000111100100000...
result:
ok
Test #39:
score: 20
Accepted
time: 2ms
memory: 3856kb
input:
2 4 997 1101010001001001111111101011110101100100110111010011011100101101000101101010010101001111100110110010110001000011100111000110101111100001011110110100010100110001010011001101011100001101100100010001111110100110010000110000010000101111000101110011010110111100000100100000100011111010110111011001...
output:
110101101111101101011111000100110001100101111010001101001011011011000110010100000111110100111000001110010100000100110001000110110000001011101111101001100110101010100011001000110001001110011001101101000101010000011001110111100110100110111011101101101110110001010111111111101111100011011111001100010100...
input:
2 4 997 3 2 00111111111000000011000010011100010001101111110011011110110100001001010011101001110100010000110101110100111000111111010110100001011100101101000011001110100001101110101110000101011011010001111110010100101000101000001010101101000000100001001001100100110100001101110001001011011110101001010...
output:
iunty23v7itdhugh3c110101000100100111111110101111010110010011011101001101110010110100010110101001010100111110011011001011000100001110011100011010111110000101111011010001010011000101001100110101110000110110010001000111111010011001000011000001000010111100010111001101011011110000010010000010001111101011...
result:
ok
Test #40:
score: 20
Accepted
time: 0ms
memory: 3660kb
input:
2 4 997 0011011100011111000100000010001010000010110011001110111001010100011011111011110010110010101010001100011000010111101011100100101110100100100100011110001101000011011000011111010011000100001100000100101010000000100000010111011101111111011100011110111011101110001011010010011000100110111110001111...
output:
000100110000000010001111111101010111101110001010110100011011011010011000110001000100110111010000011010001000010101110100111111110011000100011110111101001110110011011010010001001011111111001111100011000111010000010010010010111111001100001011110010011100001110001111101101110010001111100010010111101110...
input:
2 4 997 0 2 00010011000000001000111111110101011110111000101011010001101101101001100011000100010011011101000001101000100001010111010011111111001100010001111011110100111011001101101001000100101111111100111110001100011101000001001001001011111100110000101111001001110000111000111110110111001000111110001...
output:
iunty23v7itdhugh3c001101110001111100010000001000101000001011001100111011100101010001101111101111001011001010101000110001100001011110101110010010111010010010010001111000110100001101100001111101001100010000110000010010101000000010000001011101110111111101110001111011101110111000101101001001100010011011...
result:
ok
Test #41:
score: 20
Accepted
time: 2ms
memory: 3632kb
input:
2 4 997 0010010101111001011101001101011100001111011011000001100110000011100111111011001101100101110010100000010100100000111100010011011110011101011110001101011110111110100011100010000011110011011011001101001101010100111101101100110011001011000110010010010101110010010101000010011111011101010001011100...
output:
000101100101110100110111001010001011100001011110000100001100000110110110110110111011000011000111110001011101111111100010000101000101000111110101110111001111011010011101001001100110011001000001100100011111001111010010010010001100011101101000111111101010100111010001001000110010101010001011111010110011...
input:
2 4 997 0 1 00010110010111010011011100101000101110000101111000010000110000011011011011011011101100001100011111000101110111111110001000010100010100011111010111011100111101101001110100100110011001100100000110010001111100111101001001001000110001110110100011111110101010011101000100100011001010101000101...
output:
iunty23v7itdhugh3c001001010111100101110100110101110000111101101100000110011000001110011111101100110110010111001010000001010010000011110001001101111001110101111000110101111011111010001110001000001111001101101100110100110101010011110110110011001100101100011001001001010111001001010100001001111101110101...
result:
ok
Test #42:
score: 20
Accepted
time: 2ms
memory: 3640kb
input:
2 4 997 0110110001101000000110100001101110000011010000011001100010110111010110111110011001111010001011011100011011110101111010000111101110000110100100010001101101011000101011101011001011001011010100101110011010111110011001100110111110000010011101010011000110000101001100000000011001101110001111000010...
output:
011101100010001010000100101010010110110101100011110111011110011010011000001001101011100011100100110110110101011110000101000010010000000101110011000111100000101011110010100101111110011110110111001110001001110000101010010110000100101101011000111011010010001101000111111000111010001111001001000011101101...
input:
2 4 997 0 2 01110110001000101000010010101001011011010110001111011101111001101001100000100110101110001110010011011011010101111000010100001001000000010111001100011110000010101111001010010111111001111011011100111000100111000010101001011000010010110101100011101101001000110100011111100011101000111100100...
output:
iunty23v7itdhugh3c011011000110100000011010000110111000001101000001100110001011011101011011111001100111101000101101110001101111010111101000011110111000011010010001000110110101100010101110101100101100101101010010111001101011111001100110011011111000001001110101001100011000010100110000000001100110111000...
result:
ok
Test #43:
score: 20
Accepted
time: 2ms
memory: 3528kb
input:
2 4 997 1100110011100011111100010110000110010010111100000110010000001110101110101111101100010100111110100100001101010110101000110000101100001101001101011100110110110011010011011000000101101101011010101000000010110001101111000011011001101001011010111101010111100011000000011011111101010100110100010111...
output:
111111001100010010001100010100111010111000011110010001011000001000110001111110000111100001110110100010001011000101100110110111000000101101011100010011010101111000000101110010111100110000111100001011011100011010111111000101110001001111100000100110110101111001001001100000100110011001100010010001101101...
input:
2 4 997 1 0 00001011110110010110110010000010111011110100111000110110101100110001110100011111000100011001101000001101110011101001101101011011000111110100010111111110001011001111110111111101000001011111011111010000101100101010010101001001001000011111000010111001000000100010101001000010011100010001000...
output:
iunty23v7itdhugh3c110011001110001111110001011000011001001011110000011001000000111010111010111110110001010011111010010000110101011010100011000010110000110100110101110011011011001101001101100000010110110101101010100000001011000110111100001101100110100101101011110101011110001100000001101111110101010011...
result:
ok
Test #44:
score: 20
Accepted
time: 2ms
memory: 3828kb
input:
2 4 997 0001100110100101101101010001010011011001101101101110011001010100000111111100000011111101100111001101101011101011010000100011100011111000111100010110101001100100000100000001110010100010110000011001010110011001100010110011101001010111110001011100111101100000101011011001001011111001111110010000...
output:
001010011001000111101001110101010011110011111011111011100100001011101100011001010000001110001100100110101010001001011101111101001011100011101110000011111010010111101110111100110000000010001010011010001010010011011001001111101010001111010011110011001101110100111011101001011111001000110011011011110000...
input:
2 4 997 1 3 01011001110101000101111010100100011100001101010001101011001011001100110110101000010001001010000101010101001111100111000100111000100101101101110100101101100101011011010111101011011110001111101101100110000011010001011011111001110010000001010100000100001101101101111001011101101111010110100...
output:
iunty23v7itdhugh3c000110011010010110110101000101001101100110110110111001100101010000011111110000001111110110011100110110101110101101000010001110001111100011110001011010100110010000010000000111001010001011000001100101011001100110001011001110100101011111000101110011110110000010101101100100101111100111...
result:
ok
Test #45:
score: 20
Accepted
time: 2ms
memory: 3592kb
input:
2 4 997 0000001000100010000111111000000101110100001001010111001111010100000011110001101101011100101111011100000110001011111000001001111011010100010111010101010000111000010110010010111101110110101000010100001100010000110011101110100110000010000111101100101001000001110111001100000100000100110111100001...
output:
000000000011100001010001010011010011001001111011110010101100101111010111010100100110001101011000010000001111111010000011111001001111110000011111000100011010001000101111101011010100100100011011000010101110110101001000100111111110011010101001100000010100100110011010101011011100101010011101011111001010...
input:
2 4 997 1 0 00101010011100011100100111110100001101110100110100010011100001100100010101001100010110111110100100110100001010010010011000100001010000010000011001110000000001110110100110001100010010010010110101100110100111000011000100011000101110001010110011100010000001011000001111101111100001000110001...
output:
iunty23v7itdhugh3c000000100010001000011111100000010111010000100101011100111101010000001111000110110101110010111101110000011000101111100000100111101101010001011101010101000011100001011001001011110111011010100001010000110001000011001110111010011000001000011110110010100100000111011100110000010000010011...
result:
ok
Test #46:
score: 20
Accepted
time: 2ms
memory: 3864kb
input:
2 4 997 1101111001001011101000011101011010101001010111100000010101101011111010110111000010001010100110001000010011000101110100100111101101011111101111011111010000010001001101110010000110000010010110011001001010111111000010110001011000101110100101001010010111100100011011010011011100010100011111111000...
output:
111101101000110110100111000101101110010010101010100111011100011001111011110100000001000010000110100010110010000100111001100111010111000100010111101110111100100011000011100011101001010000010101011001010010001001110001001011001100010001100001001100001010011010000000100011000110110010010011110111011110...
input:
2 4 997 0 3 11110110100011011010011100010110111001001010101010011101110001100111101111010000000100001000011010001011001000010011100110011101011100010001011110111011110010001100001110001110100101000001010101100101001000100111000100101100110001000110000100110000101001101000000010001100011011001001001...
output:
iunty23v7itdhugh3c110111100100101110100001110101101010100101011110000001010110101111101011011100001000101010011000100001001100010111010010011110110101111110111101111101000001000100110111001000011000001001011001100100101011111100001011000101100010111010010100101001011110010001101101001101110001010001...
result:
ok
Test #47:
score: 20
Accepted
time: 2ms
memory: 3524kb
input:
2 4 997 1100000101010010111011000010010111010110111001101101101111011101110101101110010000011001101011100000001101000110110001000011101010101111010100111111101100000100010101010111101010101011100010000111100011100101110011010111101100010000110010011100101101100101111110001101011100110110000011101010...
output:
110001001111000111011101111011111101110100101011000001011101001010110100111000010101011010101010011011011111011000001110111001011110110100010011100110100010011111111010110011100100001100010110011101010010001001000100000111100010001111100100100101100010010100001001011001101100110101000110010011001110...
input:
2 4 997 0 3 11000100111100011101110111101111110111010010101100000101110100101011010011100001010101101010101001101101111101100000111011100101111011010001001110011010001001111111101011001110010000110001011001110101001000100100010000011110001000111110010010010110001001010000100101100110110011010100011...
output:
iunty23v7itdhugh3c110000010101001011101100001001011101011011100110110110111101110111010110111001000001100110101110000000110100011011000100001110101010111101010011111110110000010001010101011110101010101110001000011110001110010111001101011110110001000011001001110010110110010111111000110101110011011000...
result:
ok
Test #48:
score: 20
Accepted
time: 2ms
memory: 3580kb
input:
2 4 997 0101100101001100100011111011001111111101111100010000101001110111010001101001010001001010001001111000101010000111100000001001010101000110011001001101011111100000100111000010010000001111110011110100001011111001110010110000100011111010110101010110110100100100101111001001010100010011100011101001...
output:
011001111011100011111100001001010101100101100001101010011000100101010101110111001011000100111111010011101110001011101101011100011011100100001011100100101001101001100000110000010001100010101011011001100001000101001110001000101101110101011010101010101100001001101100100100000101000101101101111110001111...
input:
2 4 997 2 3 00110111100001110010000100001010011111010100101010001010100011000111110110100100111110010000110001100011110100100000100011101001011111000111100111000000101010010001011100101100010100010100110010110111101110001011111110111111100001001101110011001000011100110000001010010111111110000001000...
output:
iunty23v7itdhugh3c010110010100110010001111101100111111110111110001000010100111011101000110100101000100101000100111100010101000011110000000100101010100011001100100110101111110000010011100001001000000111111001111010000101111100111001011000010001111101011010101011011010010010010111100100101010001001110...
result:
ok
Subtask #4:
score: 25
Accepted
Test #49:
score: 25
Accepted
time: 2ms
memory: 3868kb
input:
3 5 997 0000010100111001110011100111100000111111111111000110001011000000110110111100110101100100011010000101010000110011111010111000100011100000000111010111111001000001000000110001010101011111001100000110111000100001110111000010010101011100110101111111001010110110111000111101000111010110100100010010...
output:
000110000100111101100001110101100100001010000001011000000001111101100001000111011110011011010101001100000110001101000110111000110101011010000110111110111010000100110100110011011010100101010000101110001101100101110000111010000100000111101101110011011010111111001011111001100001100001001111101111111000...
input:
3 5 997 2 4 1 011111101011110000001111111001000111111110100001110000110101000011101100010111110011111100011001101100010100011100010001100101111000101000000111001011000110110001110000101010100101111101011001010111010100100010110011100011001000010100110010100111110001001101000001001000011001101011100...
output:
iunty23v7itdhugh3c000001010011100111001110011110000011111111111100011000101100000011011011110011010110010001101000010101000011001111101011100010001110000000011101011111100100000100000011000101010101111100110000011011100010000111011100001001010101110011010111111100101011011011100011110100011101011010...
result:
ok
Test #50:
score: 25
Accepted
time: 2ms
memory: 3588kb
input:
3 5 997 1001001000001111111110111011001010001100011010011001011100101010100111000111000001010100100110001111111110111001111111101001110111100010110000100111000000011001001111001011100001000001010101100111111011000010100100111011010111110100110000000001100100001111010111101010110100100100100100011100...
output:
101011111010111010111001010001011111101110010000010010111000000101100001100101000001110110010101111100010010110001001100010001000001010011101011110110111111101000101010010011010000111011001010000111111100011011100110000000111011110011101110101011101101010100111110111010101000110011110110001001100101...
input:
3 5 997 3 1 0 111011100100100110011010100011111110001000000110100111001101001001010010000110001101010011111100011010010110011000111100110100100101101110011010001100111011011001111100001011010010001001110011110111101100011000101010011111000011001001111000010111101010011100011010100111111011100001100...
output:
iunty23v7itdhugh3c100100100000111111111011101100101000110001101001100101110010101010011100011100000101010010011000111111111011100111111110100111011110001011000010011100000001100100111100101110000100000101010110011111101100001010010011101101011111010011000000000110010000111101011110101011010010010010...
result:
ok
Test #51:
score: 25
Accepted
time: 2ms
memory: 3656kb
input:
3 5 997 0110000110001110010110111100100111100010000000100101010101101100011100011010101011100001110100010011111101011100000110010110101011000101111000110111101101000100000001000000100011111001101000000001001011111011111101010111010000010000101110101110111101000011110011100111000110100001000010000000...
output:
010111011101000001011111101000010011110101100110011101000000101000101011010000111111000001010000000110010011110100111000100111100010011110010000001110011000110010011001011010001101110000100110111101000011110011000100001101011010010110001000000000110001011111111101101000000100000111011101011010101001...
input:
3 5 997 1 3 0 101010100011100001010000101101001101001010110100110100010011010001111101110000101001111111100110000101100101100111001111110110100110000011001001000000101010100100111111001011010100001000000101000010001101001111011100000011111001100100000000111010010111111000001000001000110010101110101...
output:
iunty23v7itdhugh3c011000011000111001011011110010011110001000000010010101010110110001110001101010101110000111010001001111110101110000011001011010101100010111100011011110110100010000000100000010001111100110100000000100101111101111110101011101000001000010111010111011110100001111001110011100011010000100...
result:
ok
Test #52:
score: 25
Accepted
time: 2ms
memory: 3640kb
input:
3 5 997 1010101001110111011111001000000000011110111001111100000110100010001101000001111100101010011010010100101001100101110111011110100000001010111110010100001011101110011010011000111100010011011111111100000111001011011010101100110100111111100110100100000000110000010101010101000000110000110100101111...
output:
101001111000111011010011001110100110010111001011011011101011001111011010110111010100000101000001110010000000110111100011100111110000000010011000010110100100110011110001111101110111010000000000101110101111011011011010001011111011010111000001000000000010010101011010101100000000110001101101110001100000...
input:
3 5 997 1 0 4 100111110000100100101001010010100001011110001010001110100000111100111110000011100000000101000000110101101010111110101111111100111010111011110011111101001100110101001111011101101110001101011101011011001101010010100010001101000011111100000100011011111011011100110100010001011011100011001...
output:
iunty23v7itdhugh3c101010100111011101111100100000000001111011100111110000011010001000110100000111110010101001101001010010100110010111011101111010000000101011111001010000101110111001101001100011110001001101111111110000011100101101101010110011010011111110011010010000000011000001010101010100000011000011...
result:
ok
Test #53:
score: 25
Accepted
time: 2ms
memory: 3600kb
input:
3 5 997 1001001101110001011001101100011101010010000011010110000110010000111001100011111100100110101101100111000111101111100100110111110110111100000011100000111001011110110111101000101110010011011000011011001011111111011000101100110011110110000110100100101011110100010001011000000100110001100101111011...
output:
101100101111000001010010001101110101110101011100001011011011001010101110110001010110010010010001100000111101001001110000000011010110110100110001100000100000010001011000010111101001010101110101100000101001101001111101110001100111011110110110000000000111011111101011010011101011101110101101100010110100...
input:
3 5 997 0 1 3 101100101111000001010010001101110101110101011100001011011011001010101110110001010110010010010001100000111101001001110000000011010110110100110001100000100000010001011000010111101001010101110101100000101001101001111101110001100111011110110110000000000111011111101011010011101011101110101...
output:
iunty23v7itdhugh3c100100110111000101100110110001110101001000001101011000011001000011100110001111110010011010110110011100011110111110010011011111011011110000001110000011100101111011011110100010111001001101100001101100101111111101100010110011001111011000011010010010101111010001000101100000010011000110...
result:
ok
Test #54:
score: 25
Accepted
time: 2ms
memory: 3864kb
input:
3 5 997 0110101101011000100011000000111111001000001000010101001011011101110100000101001110011001101011111101101011111111011000010100110100100110110100110010110111100001101011010011010110101111010110111010111111100010100110001110001111000101010101011101100001011101010101110010111001100111110101111001...
output:
011110000011101001101101011110101110111001010101000100100001110110110001111101011100110100100101100001000110011101011011010110100100111010010110101110011111111110101000010111100000110000010110100010011110110010100101011001100110001001101010100001101011011110111101011011110110100100101011000101100100...
input:
3 5 997 2 4 0 100110001100000100011100000110111011010111101111111010010110011111101000000001011001011111101111001000011110001110001110011000101100111100110011011000000101111010100101001100111000001100001001011011100111100011011111000110001000111110000010100101001100100111011000110000010000001101000...
output:
iunty23v7itdhugh3c011010110101100010001100000011111100100000100001010100101101110111010000010100111001100110101111110110101111111101100001010011010010011011010011001011011110000110101101001101011010111101011011101011111110001010011000111000111100010101010101110110000101110101010111001011100110011111...
result:
ok
Test #55:
score: 25
Accepted
time: 2ms
memory: 3656kb
input:
3 5 997 0000100101110000101110001000001101001010110010010001000010011110010101101000111011011111101101001000111001010000110010010100110100100111000010100101001000000000000011101001011001010111010001100111011011100011011100101101011111110011011000101101001110000010010001000101110010110011011001011100...
output:
000100111011100000001101101011111010000001010100011000001010010001100011111100101111000001000010111110011010110011110110101101011001001011101101001110111100011111011011010111111000100110011100111001101111001010010101000110110100010101010111000100101001010000011101010110011100011010000010000001010111...
input:
3 5 997 3 2 0 101110011010111101110010010010100110111110111000001000011010111111111001111110001001110111011010110001101001111101101111010001101100000000111100011001111100101000011110111100101101111000001010001010001111011101111010010101011101000011110011100100001011101000000001100110110110001011010...
output:
iunty23v7itdhugh3c000010010111000010111000100000110100101011001001000100001001111001010110100011101101111110110100100011100101000011001001010011010010011100001010010100100000000000001110100101100101011101000110011101101110001101110010110101111111001101100010110100111000001001000100010111001011001101...
result:
ok
Test #56:
score: 25
Accepted
time: 2ms
memory: 3832kb
input:
3 5 997 1110101000111001100010110010100001100110000111101010010100100011101000101110101111110011000001001100001100110010110110010100111000010000000010010111011001000101000111111101111000110110110100101100000111001001001101101111110100101011110011111001110101000011000111110111001001001000101001101001...
output:
111010000000010110010010111100001111000101100000011001011110010111011011110110001001000101101010101001110010100111100110000110101101010010100111011101110101011101010010100000010101011000010110100000011010101000110010000000100011001110011100010001110000110001110110011010000101110010111111100100011001...
input:
3 5 997 2 3 4 101110111010001001101010101100000011110111010001010000111111111000000010111011111100001100001010011000110100010111100101110001100101000001101001100111101111111010111011101011000110101010000001001000101001010000000001010000001011001111101100011101001110001101100111110001011001010000111...
output:
iunty23v7itdhugh3c111010100011100110001011001010000110011000011110101001010010001110100010111010111111001100000100110000110011001011011001010011100001000000001001011101100100010100011111110111100011011011010010110000011100100100110110111111010010101111001111100111010100001100011111011100100100100010...
result:
ok
Test #57:
score: 25
Accepted
time: 2ms
memory: 3592kb
input:
3 5 997 1000000110001100000001100011101110100011100111110101101101010100001101110011011100110001000111000001010111101000110001111010010110000001111111100110011110100001111001001011001000011100001110111011000110100000100101111100010111110011101001111101100010110111010100111100011111100101111001010000...
output:
100111000011000101110111001100010001100010010011011100101010111110010001110100101100010111110110000100010001110010010101100110011001000111000000110010000011011000111000100000010110101111100110011010010011111101100000010001101100101001001010011010111000001011101000100010000000100000001011110110010110...
input:
3 5 997 2 0 4 000000101010101110010011011100000110111101001110011011000001001100101011011110111011011101101101001110101010000100100110101110111100110101011010101010010110100101101010011001101011010111100010000101110111110110011011101110011011010000110001001101100100001110111100010111110110101011100...
output:
iunty23v7itdhugh3c100000011000110000000110001110111010001110011111010110110101010000110111001101110011000100011100000101011110100011000111101001011000000111111110011001111010000111100100101100100001110000111011101100011010000010010111110001011111001110100111110110001011011101010011110001111110010111...
result:
ok
Test #58:
score: 25
Accepted
time: 2ms
memory: 3864kb
input:
3 5 997 0100101001011010110000011100010101000101111010001000111011101010001110000101111011101000000101110100110100000010000100011000000111100010111101000011000001101001100000101010001001111010101001100000101001010101110100010011111110011100001010110011000101100111011000001000001101111110010001101111...
output:
011010001101011010101011011010010101000110010011000010001010101000100101001111100001011010111100111111011100110000010110111011010101010011010110110111010111100000110001000000010101001110101011010010011110101000001110010101001011011011111010010110010000010111001000011000100100000101100100000100010101...
input:
3 5 997 1 0 2 000110000001011000111010011100010000100000111001110101001001100100010100111000101101110000011001111110000111011010000101100011110010001011011110110001111001110110000100011010110101011001110111100000110000011101101011010000011100100101001101101111110101001111010011000011010101001110001...
output:
iunty23v7itdhugh3c010010100101101011000001110001010100010111101000100011101110101000111000010111101110100000010111010011010000001000010001100000011110001011110100001100000110100110000010101000100111101010100110000010100101010111010001001111111001110000101011001100010110011101100000100000110111111001...
result:
ok
Test #59:
score: 25
Accepted
time: 0ms
memory: 3880kb
input:
3 5 998 0100101100001010100010001011100111000101111000001000101110000001000001101000010110110011111110110100001011011000111100101000101000100010110010010010100000110011010010000011101100001110000101110100110101000010110111101001111011100010101101110001101100010001110100110110011110110101011100011000...
output:
011110001001011010110000100100110110101110100000000000000011110101010001101000110011000101110111101001010111000110110100101100101000000111000111100000011000010110011000010111010100101001001100110001001111111001111101010011111110101101111110000010001010111001011001100100100010001011011001011100111100...
input:
3 5 998 4 1 0 000100011100101101001101100001111000001101011000111111010001001001011010111111010100000110110000001101011000100010100010011100110000000000000110000110011001110000010010011111101111010110000001010011011001100110101111101111110100111110110001101100101100110010001101011011010110100111011...
output:
iunty23v7itdhugh3c010010110000101010001000101110011100010111100000100010111000000100000110100001011011001111111011010000101101100011110010100010100010001011001001001010000011001101001000001110110000111000010111010011010100001011011110100111101110001010110111000110110001000111010011011001111011010101...
result:
ok
Test #60:
score: 25
Accepted
time: 2ms
memory: 3636kb
input:
3 5 998 0101101011010000011010000000110110010100011111011111010011011010110000100111100100010011110001010010101001001111100111000010110100000010000100111110000011011000000110001100000100110000010110011110110100001100101000111110000011010001011011100111100000111011110001010010000011010111001000101011...
output:
011000100001011111001000010100000010110100010001110010011101000111011110110000100100100000000110100111110011011000011111011001110101000100110011000000010001000101011100000100000000100010010010010110001111001011001010101010110011010001010111011110101100111110100001111100100111101101000110011000000100...
input:
3 5 998 2 1 3 100101001101010101011110100111011000100011000011000100000011010111001011000101101011110100010010010101110010010101101010101111111010011100010101101011100101000011111101111111011111100101100101010010000010010011100100111010110010001101010100001000111000000101010101010110100110111011110...
output:
iunty23v7itdhugh3c010110101101000001101000000011011001010001111101111101001101101011000010011110010001001111000101001010100100111110011100001011010000001000010011111000001101100000011000110000010011000001011001111011010000110010100011111000001101000101101110011110000011101111000101001000001101011100...
result:
ok
Test #61:
score: 25
Accepted
time: 2ms
memory: 3584kb
input:
3 5 998 1010010011101101011010000001011111100000001110101101010000111111000100111011101100101110010001000000100001100001001010010010111001001111101100111001000011010100001011110001000001101010111101001110001010111011110100010011110011011010010100011110010001100110010010001001001001100010000010011001...
output:
100011100011001111001101101111000000001000101111100001100000101111101001000010011100010010100000101011111010110010011011111010100110010000100111010110101101111100100001101110010000111000111110110100101001011101101000100000110110111010011100001101110011101101110110110011101011001111111011111101111110...
input:
3 5 998 4 0 3 110011101001001011111101111101111001111110000110001110101101011000011011011111110101100100100100000011011010110101100000100010000101000101011110010110011100101001111101111000110001111011001101110110000001000100011101100001100100001001100010001011011110101001100011000000001111110111100...
output:
iunty23v7itdhugh3c101001001110110101101000000101111110000000111010110101000011111100010011101110110010111001000100000010000110000100101001001011100100111110110011100100001101010000101111000100000110101011110100111000101011101111010001001111001101101001010001111001000110011001001000100100100110001000...
result:
ok
Test #62:
score: 25
Accepted
time: 2ms
memory: 3564kb
input:
3 5 998 1001100110101101010011001110010110010000011111010100000011110001000100101011010000000011111001100101101001010010010000110011101010000100111010001000011111101011101101100110110100011011010011101011110000100100001100001001000111100100010000001111111010001011100110101101100010111111011011110110...
output:
100111001101001101000001100000100110000000100110101110110101100010000111100101001110100111001110010000100101010011010111010001011000011010011000001010000000100001011001101001001011101010010011111000010100001100101001101101011010101101010110101111101001001001000010000001111001001001010100001001101111...
input:
3 5 998 1 0 4 011001111010001100110100110011010101100011100010001111011000111111000000011100001110111001101111101100111100011100000110001011010000010110110000101001101000000010101111111100011011100011011101100010101011011011100010111111110110101010101000100101111100000111100101100000000101110110101...
output:
iunty23v7itdhugh3c100110011010110101001100111001011001000001111101010000001111000100010010101101000000001111100110010110100101001001000011001110101000010011101000100001111110101110110110011011010001101101001110101111000010010000110000100100011110010001000000111111101000101110011010110110001011111101...
result:
ok
Test #63:
score: 25
Accepted
time: 2ms
memory: 3664kb
input:
3 5 998 1100110010010001001111100001101100110111110101011001000111111100010001000000111101001110011000110101101001011110100001110000001011011011111001100000111110001100101011001110100110110101000010010000111001011000011010100110000110110110010000001110100110011001010101110001011010100011011100011100...
output:
110000110011010110011100001111100110110000101010001111101101010000101010010101001101100100100011111101011100010010011010010101110000110110000011101110000111011101111000111111100001011101100010101000110011100010100101001101011010110010011110010110011000000011010011111100101011011001010110111000001010...
input:
3 5 998 2 3 0 110100101011110100110100110001111001101100011110110010001011000111010110001101001001011101100101001001100100001110110010011110100010110101111001111111011011110001110001111101110000011011101111110100111010000110100000111010101001000110110101010111111110011101011110011101100101100011100...
output:
iunty23v7itdhugh3c110011001001000100111110000110110011011111010101100100011111110001000100000011110100111001100011010110100101111010000111000000101101101111100110000011111000110010101100111010011011010100001001000011100101100001101010011000011011011001000000111010011001100101010111000101101010001101...
result:
ok
Test #64:
score: 25
Accepted
time: 2ms
memory: 3832kb
input:
3 5 998 0111101010101011001000111010110001101010111001101001111101011100010010001101011110110100111111101111011100010111111111011101111110111101110010100011101100101001011111100100110101011101100100110000001110101010011011010011100111111111110010100000001011110101111110000000011100001011100001111010...
output:
011010101000101010111100111101111111011111111100001110110101110100111010000111000010011100111000101011111110110111000010010101011000100111001100101010010111000010110001100010010000111100000101111110100100101001010001111011110010100110100101000000011000001001001001000100001000111100110000110011111110...
input:
3 5 998 3 2 1 001001011111110100111010111010100110010101100100010110101001001000110100010111000010110101111110100011110010110001001001101011100111011110010001111101101100001011000001011011101110110000011001010000101011100100111011111100011111100110111010101100001000000110110111110010111111010101110...
output:
iunty23v7itdhugh3c011110101010101100100011101011000110101011100110100111110101110001001000110101111011010011111110111101110001011111111101110111111011110111001010001110110010100101111110010011010101110110010011000000111010101001101101001110011111111111001010000000101111010111111000000001110000101110...
result:
ok