QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#419927 | #503. IP over Avian Carrier | skittles1412 | 100 ✓ | 2ms | 3864kb | C++17 | 8.3kb | 2024-05-24 12:46:04 | 2024-05-24 12:46:06 |
Judging History
Program
#include "bits/extc++.h"
using namespace std;
template <typename T, typename... U>
void dbgh(const T& t, const U&... u) {
cerr << t;
((cerr << " | " << u), ...);
cerr << endl;
}
#ifdef DEBUG
#define dbg(...) \
cerr << "L" << __LINE__ << " [" << #__VA_ARGS__ << "]" \
<< ": "; \
dbgh(__VA_ARGS__)
#else
#define cerr \
if (false) \
cerr
#define dbg(...)
#endif
#define endl "\n"
#define long int64_t
#define sz(x) int(std::size(x))
template <typename T>
ostream& operator<<(ostream& out, const vector<T>& arr) {
out << "[";
for (int i = 0; i < sz(arr); i++) {
if (i) {
out << ", ";
}
out << arr[i];
}
return out << "]";
}
pair<vector<int>, vector<vector<char>>> row_reduce(vector<vector<char>> arr,
bool augmented,
bool rref) {
int n = sz(arr), m = sz(arr[0]);
auto add = [&](int u, int v) -> void {
for (int i = 0; i < m; i++) {
arr[v][i] ^= arr[u][i];
}
};
int row = 0, col = 0;
vector<int> pivots(n, -1);
while (row < n && col + augmented < m) {
for (int i = row; i < n; i++) {
if (arr[i][col]) {
swap(arr[i], arr[row]);
break;
}
}
if (!arr[row][col]) {
col++;
continue;
}
for (int i = row + 1; i < n; i++) {
if (arr[i][col]) {
add(row, i);
}
}
pivots[row] = col;
row++;
col++;
}
if (rref) {
for (int i = n - 1; i >= 0; i--) {
int p = pivots[i];
if (p == -1) {
continue;
}
for (int j = 0; j < i; j++) {
if (arr[j][p]) {
add(i, j);
}
}
}
}
return {pivots, arr};
}
bool is_basis(vector<vector<char>> arr) {
int n = sz(arr), m = sz(arr[0]);
assert(n == m);
return sz(row_reduce(arr, false, false).first) == n;
}
struct C {
int c, kv, n, iters;
};
struct S {
vector<vector<vector<char>>> arr;
static S c_from(const C& cf, const string& s) {
vector arr(cf.kv, vector(cf.n, vector(cf.n * cf.c, char(0))));
int si = 0;
for (auto& a : arr) {
for (auto& b : a) {
for (auto& c : b) {
c = s[si++] - '0';
}
}
}
return S {arr};
}
};
int compute_score(const C& cf, const S& s) {
int ans = 0;
bool perm[cf.kv] {};
fill_n(perm, cf.c, true);
sort(perm, perm + cf.kv);
do {
vector<vector<char>> mat;
for (int i = 0; i < cf.kv; i++) {
if (!perm[i]) {
continue;
}
mat.insert(end(mat), begin(s.arr[i]), end(s.arr[i]));
}
auto pivots = row_reduce(mat, false, false).first;
ans += sz(pivots) - int(count(begin(pivots), end(pivots), -1));
} while (next_permutation(perm, perm + cf.kv));
return ans;
}
struct ScoreManager {
static void write(const S& s) {
ofstream out("output.txt");
for (auto& a : s.arr) {
for (auto& b : a) {
for (auto& c : b) {
out << char('0' + c);
}
}
}
}
int best_score = -1, last_iter = -1;
S opt_state;
void update(int n_score, int iters, const S& s) {
if (iters - last_iter == int(1e5)) {
dbg("SAVED", best_score);
write(opt_state);
}
if (n_score <= best_score) {
return;
}
last_iter = iters;
best_score = n_score;
opt_state = s;
dbg(best_score);
}
};
struct R {
mt19937_64 cowng;
R() : cowng(chrono::steady_clock::now().time_since_epoch().count()) {}
long rint(long l, long r) {
return cowng() % (r - l + 1) + l;
}
bool rprob(double p) {
return uniform_real_distribution<double>(0, 1)(cowng) < p;
}
} R;
void sa() {
C cf {3, 5, 3, 0};
S state = [&]() {
vector arr(cf.kv, vector(cf.n, vector(cf.n * cf.c, char(0))));
for (auto& a : arr) {
for (auto& b : a) {
for (auto& c : b) {
c = R.rint(0, 1);
}
}
}
return S {arr};
}();
dbg(compute_score(cf, state));
auto accept_prob = [&](int n_score, int cur_score, double temp) -> double {
if (n_score > cur_score) {
return 1;
}
return exp((n_score - cur_score) / temp);
};
double temp = 1000;
int cur_score = compute_score(cf, state), iters = 0;
ScoreManager manager;
while (true) {
manager.update(cur_score, iters, state);
temp *= 0.999999;
if (++iters % 1000 == 0) {
dbg(temp, manager.best_score, cur_score);
}
int i1 = R.rint(0, cf.kv - 1), i2 = R.rint(0, cf.n - 1),
i3 = R.rint(0, cf.n * cf.c - 1);
state.arr[i1][i2][i3] ^= true;
int n_score = compute_score(cf, state);
if (R.rprob(accept_prob(n_score, cur_score, temp))) {
cur_score = n_score;
} else {
state.arr[i1][i2][i3] ^= true;
}
}
}
map<array<int, 3>, S> STATES = []() {
stringstream in(R"raw(3 4 2
011001000111111111110001010110101101110000000010
3 4 3
111110000000010110001110000111110110011001001101111001011110100010110110110111100000000001110100010011100001
2 4 2
11110010101010110011011010000100
2 4 3
111000100111111100010010100001100110101010111110110000101011000010001011
3 5 2
100011111010001011100111101001100100010111101011001001110110
3 5 3
001110001001000001000101011100011010000000001111000011000100011010010101110011011010011010000011101010100110111010001011011010110100100
)raw");
map<array<int, 3>, S> ans;
for (int it = 0; it < 6; it++) {
int c, kv, n;
string s;
in >> c >> kv >> n >> s;
ans[{c, kv, n}] = S::c_from(C {c, kv, n, -1}, s);
}
return ans;
}();
vector<string> encode2(int c, int kv, int n, const string& bits) {
auto s = STATES[{c, kv, n}];
vector<string> out;
for (int i = 0; i < kv; i++) {
string cs;
for (int j = 0; j < n; j++) {
char cb = 0;
for (int k = 0; k < c * n; k++) {
cb ^= s.arr[i][j][k] * (bits[k] - '0');
}
cs += char('0' + cb);
}
out.push_back(cs);
}
return out;
}
vector<string> encode(int c, int kv, int gn, string s) {
vector<string> ans(kv);
int si = 0;
for (int i = 0; i < gn;) {
int cn = 2;
if (i + 3 == gn) {
cn = 3;
}
auto cans = encode2(c, kv, cn, s.substr(si, c * cn));
si += c * cn;
i += cn;
for (int j = 0; j < kv; j++) {
ans[j] += cans[j];
}
}
return ans;
}
string decode2(int c, int kv, int n, vector<string> arr, vector<int> a_inds) {
auto s = STATES[{c, kv, n}];
vector<vector<char>> mat;
for (int i = 0; i < c; i++) {
for (int j = 0; j < n; j++) {
mat.push_back(s.arr[a_inds[i]][j]);
mat.back().push_back(arr[i][j] - '0');
}
}
mat = row_reduce(mat, true, true).second;
string ans;
for (auto& a : mat) {
ans += char('0' + a.back());
}
return ans;
}
string decode(int c, int kv, int gn, vector<string> arr, vector<int> a_inds) {
string ans;
int si = 0;
for (int i = 0; i < gn;) {
int cn = 2;
if (i + 3 == gn) {
cn = 3;
}
vector<string> carr;
for (auto& a : arr) {
carr.push_back(a.substr(si, cn));
}
auto cans = decode2(c, kv, cn, carr, a_inds);
si += cn;
i += cn;
ans += cans;
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 30
Accepted
Test #1:
score: 30
Accepted
time: 2ms
memory: 3708kb
input:
3 4 997 0011010101101011001011000101111100100010100100011010011101111011000100110011101111011100011101011100100000011100111011011010010111011100001101010101000101110110011000100001101111100110000101101010110111110010101100110100010011011010010110001110111001000110101010110000101010111011010010101101...
output:
001011110111110101011100101001001111000001101000110111010000001000111100010001001001010001000011100100100101010011011110101111011101010101011011111010100011010111011000000001100001111110111101111101011111101011110101111101111000111101111000110101100010110011110110101110100000011000010110110001011001...
input:
3 4 997 0 1 2 001011110111110101011100101001001111000001101000110111010000001000111100010001001001010001000011100100100101010011011110101111011101010101011011111010100011010111011000000001100001111110111101111101011111101011110101111101111000111101111000110101100010110011110110101110100000011000010...
output:
iunty23v7itdhugh3c001101010110101100101100010111110010001010010001101001110111101100010011001110111101110001110101110010000001110011101101101001011101110000110101010100010111011001100010000110111110011000010110101011011111001010110011010001001101101001011000111011100100011010101011000010101011101101...
result:
ok
Test #2:
score: 30
Accepted
time: 2ms
memory: 3588kb
input:
3 4 997 1111100001010101110011100111000010110010101101100000011110111011111001011000100011010100110000001000111010010111000000000010110100100100001000001101100010110110010111101111110011101011010110110110101111101000011101110110110111011001010100000011110110000000011011010111111001110100001111001011...
output:
001001100100111011100110010000001001010000111000100011001110001001001101101010100100110011111001100011101011111001001100110101000011001101110010110000111110101101001110100101111010100000101111101111000101010100001000111101111000001010100100111110000000001010001011100100011111101001010100101111001000...
input:
3 4 997 0 1 2 001001100100111011100110010000001001010000111000100011001110001001001101101010100100110011111001100011101011111001001100110101000011001101110010110000111110101101001110100101111010100000101111101111000101010100001000111101111000001010100100111110000000001010001011100100011111101001010...
output:
iunty23v7itdhugh3c111110000101010111001110011100001011001010110110000001111011101111100101100010001101010011000000100011101001011100000000001011010010010000100000110110001011011001011110111111001110101101011011011010111110100001110111011011011101100101010000001111011000000001101101011111100111010000...
result:
ok
Test #3:
score: 30
Accepted
time: 0ms
memory: 3556kb
input:
3 4 997 1001110110011100101110011010101011011100000000010000101101100000110000111101001101011010101111000110011101011011100000000011000001000110101101111110100110100010000110101001101011111101110111000011110001011000101010000000000001000101100100000111010110110101000100100110110100001110101110111110...
output:
111111111100101101101010110011011100100011010101010110010001010101100110000110101010111110100110110101011101000101100110011000001011000110110000000001100000110000000111000110000000100000000010010010011101010100111011010000111101000010111110011111001110000100111000000101110111001111010010001001011001...
input:
3 4 997 2 0 1 011001111010110110101111000110011001010010110111000101010000110001101100001111100100010000100001110100010000001111011100101100010110010001101111101101010100001101100100111010010001001100100011000100100001110111100011101110111010101100010011110000000100000100010010100110011111000110110...
output:
iunty23v7itdhugh3c100111011001110010111001101010101101110000000001000010110110000011000011110100110101101010111100011001110101101110000000001100000100011010110111111010011010001000011010100110101111110111011100001111000101100010101000000000000100010110010000011101011011010100010010011011010000111010...
result:
ok
Test #4:
score: 30
Accepted
time: 2ms
memory: 3792kb
input:
3 4 997 1101100101110111011100111100000010000000000010111101111101111011100110101011111001111101010000011110110011010110101111010010001100010111000010111100000111111101011101001110101011010000010110101111101101010110001110101100001111000101001100110000100100110010100011101000000000010011001010000111...
output:
100110001010000001011001011100111000011010010100101100110100110100000001100111000100111000111110011011001100111111111010111100110100000011101101010110100010010010101011101111101001110101111011011010010101100100101111000111100110111010100010100100101101101111011000110110111001010000010111101000000001...
input:
3 4 997 1 3 0 000000010010001111110111100001111111111110111111001001100000111110010100000001011010001011110001111101001001111000010101100110101000011100100101010111111010010110001101010100011110101000011010001101110111011010010110101001110010110001000010001110011011001011000000100001101110111101000...
output:
iunty23v7itdhugh3c110110010111011101110011110000001000000000001011110111110111101110011010101111100111110101000001111011001101011010111101001000110001011100001011110000011111110101110100111010101101000001011010111110110101011000111010110000111100010100110011000010010011001010001110100000000001001100...
result:
ok
Test #5:
score: 30
Accepted
time: 2ms
memory: 3804kb
input:
3 4 997 0110011010100011111110011100111101011000101001100010100001100001001000001001001100101111010111000100101001100101000010010010111111001110111001101001101010000000010000000001001000011000100010101001101101100101001010101111101000100100100010111110110010101101000001000000010101010101010000100111...
output:
111101110000010011000100011110011100110100011000001011000111011100101111000111001011110111000001001001001100001001111101000011111001011010101000110011110111100100100110000110111010111010010011001010100111101110110101111111010111111000101110010110110011011011100010010000001000000010011111110100000111...
input:
3 4 997 3 0 1 101101000100111101010010100100101111100001000111111000000010110111011011011111010101000000101001110000111001000011100110010110001100011001000100011100101001111011000000010011010101100000111010101001111011000010100100110101011010100100100101101110001111111000100111100101110110101111111...
output:
iunty23v7itdhugh3c011001101010001111111001110011110101100010100110001010000110000100100000100100110010111101011100010010100110010100001001001011111100111011100110100110101000000001000000000100100001100010001010100110110110010100101010111110100010010010001011111011001010110100000100000001010101010101...
result:
ok
Test #6:
score: 30
Accepted
time: 2ms
memory: 3552kb
input:
3 4 997 0110100001110010011011101101010011110000010111100111001100001110011111010110000010000000010001101111100001001011010001101011111111110001100100111000111110010111000111000111101001110100111000101011010110000000111010011011000000010111000000111111011101011101110101101001101000101001111000111100...
output:
011101100001110001101110001011000001000001110000101101010011000100001001111101101000011000011110000001110010001100111110111011011011100100010011100001110111110101011001111110110001101110010010001110101010001001111000100110000101001100011010110111011110100000110011010010011100000110001100011111111100...
input:
3 4 997 2 1 0 010000010101011000111100110101011111100100100101101100001001011110111101110100110001111100110110001011011101101100110001101010011011111111111111100011010001011001110101110111100011010101011111101101111111100111000001010011000101100000011111001010000110000111010011111010100101100011000...
output:
iunty23v7itdhugh3c011010000111001001101110110101001111000001011110011100110000111001111101011000001000000001000110111110000100101101000110101111111111000110010011100011111001011100011100011110100111010011100010101101011000000011101001101100000001011100000011111101110101110111010110100110100010100111...
result:
ok
Test #7:
score: 30
Accepted
time: 2ms
memory: 3660kb
input:
3 4 997 1100011010001011010001111001111011111011110001001100101101100101110011010110001001110001111000110011000111011100011100101110010001010111011111010011000000000101000100100100001100001011011010100110010011111100101100111110100100001010110000000101011111111011000011010001111110110100011111110000...
output:
011000111101010111100100001111101110011111101010110011111010001111011100011000000011110011100111101000011110100010110001010011110111010101110010011000000110001111011101010100110000010110100101110010111101101001101000101001001000110010100110111101000101001100011001100100000000001010011010001101011100...
input:
3 4 997 2 3 1 100010000100001101101011110100101001100111100100100001001011101010010100001011000010111100011110110010010011100111110110101100000011111111110110000000100011111010011001001101101100011011111100001001011001100011000010101010000101111001001101011100011010000011101001001010011011110101000...
output:
iunty23v7itdhugh3c110001101000101101000111100111101111101111000100110010110110010111001101011000100111000111100011001100011101110001110010111001000101011101111101001100000000010100010010010000110000101101101010011001001111110010110011111010010000101011000000010101111111101100001101000111111011010001...
result:
ok
Test #8:
score: 30
Accepted
time: 2ms
memory: 3860kb
input:
3 4 997 0110101110010011001000010000111010101011000110001011101010100110010100001100011101100111100010110000010010000100111001100001100011000000110110001000101011000111110000001000110010010010001111111110111111111010001010100110011011100011011011001011101010100110111001101100111110110011011011000100...
output:
011111111011110010111110011000001110000000111000011111001001101110111011111000111011100000100011111110110011010111001111000001001100010000101000101001010101011101010111101000011110001000010111111011001111101110000101100111100100111111111110010010000101110000110101110110000101001011000111010100000100...
input:
3 4 997 2 0 3 011110001110111101101010101010100101010001101111111111001000011001100010100111110110000000011111001111111100011011011110100011111001110011101001100111100110001011111000100000000011110010111101101011111101000010001110110100110010101111101011100000100110111011111100100110000010110111111...
output:
iunty23v7itdhugh3c011010111001001100100001000011101010101100011000101110101010011001010000110001110110011110001011000001001000010011100110000110001100000011011000100010101100011111000000100011001001001000111111111011111111101000101010011001101110001101101100101110101010011011100110110011111011001101...
result:
ok
Test #9:
score: 30
Accepted
time: 2ms
memory: 3788kb
input:
3 4 997 1010101010001000001101010111110011101100010111000111100010010110110101011110100010100001111000000010001110101000000100100011111100000100010111111101001111010100101110101001101000101001010100110011001001111000100000010101110010001000001101101011110110111110110111100010011111001011000001100100...
output:
111000001110010100011000011111001001001101100111111011010001100011110111011000100110100001011100000010001111101100101111111011011000000111100101101010100011010000100100100010010010001001010111001111111110010111011011000000110010011001011000000010001011111111001100101011111111100001000100001111110010...
input:
3 4 997 3 0 2 111010001101001011001110010101100001101101001011000011011111101100111100110010011111011100001001111110011110111110010010001001101100111101100011110101010111101001001010110111000111111100001000111111011011001000000010011010100001101011111011100111000101110110010001011010100000101111011...
output:
iunty23v7itdhugh3c101010101000100000110101011111001110110001011100011110001001011011010101111010001010000111100000001000111010100000010010001111110000010001011111110100111101010010111010100110100010100101010011001100100111100010000001010111001000100000110110101111011011111011011110001001111100101100...
result:
ok
Test #10:
score: 30
Accepted
time: 2ms
memory: 3660kb
input:
3 4 997 0001010010010000101001001110010010101001110010111001111111011101101111000001101100111110110000101000000001100001010001110111111100000110111011000011010101111001001110000100100000101001100010101110001101010001011101000011000000001010010111011101101001010000110100111110010100110111100010101101...
output:
100101011111110011101001000010010000101111101011000101001101001100001011110001101010100011000011111001010110011000000001101110001100100010010101000100010000000111001100001001001101111111010000111011000111101011001111110110000000111110010111000011100110001110100010100011000001110101011010001000111010...
input:
3 4 997 2 3 0 100010101111011001001001010001100101100011110011111010100010001110011000100001011011110111011011000000110110011011010010110110100101011111011001000111010110111111100111111100011111000101110111101110000010000101000011001001101100101110110011111101001101100000111000111000010000101101110...
output:
iunty23v7itdhugh3c000101001001000010100100111001001010100111001011100111111101110110111100000110110011111011000010100000000110000101000111011111110000011011101100001101010111100100111000010010000010100110001010111000110101000101110100001100000000101001011101110110100101000011010011111001010011011110...
result:
ok
Test #11:
score: 30
Accepted
time: 0ms
memory: 3720kb
input:
3 4 997 0100110100101010101000001010101110001110001000000101000011011101110110101011110010000111101011111011101000101111010011100111010100110000110101111110100101101011100111000011000111100100111010000000110101010111101111001100100100110001110001101001101010100101000100111100100111010110100100011110...
output:
001111001100000011000101011000011001101010001001011010011100001010000001110011000011110011100101111000000110111000000110110100010110110010111111011001100100001100010010011010100001101101111101110101000101111001110101111000111111100010010111110110101100001011110111100110010111010010111111000011011010...
input:
3 4 997 2 0 3 010010011010100101111101000110000111000001011110001101001010010011001001010100010010010101010111111001001100011001010001110001111110110011001101011110010101001110000001010100111110100111111010011110010000010011000001111101101101110110110011100100010011111000111010100000110111001000001...
output:
iunty23v7itdhugh3c010011010010101010100000101010111000111000100000010100001101110111011010101111001000011110101111101110100010111101001110011101010011000011010111111010010110101110011100001100011110010011101000000011010101011110111100110010010011000111000110100110101010010100010011110010011101011010...
result:
ok
Test #12:
score: 30
Accepted
time: 2ms
memory: 3788kb
input:
3 4 997 0001011101010010101010110110111100100111101010101001000100010100011011111001101011001110101100111111000010100010011100010110010111101011001110011101011001101111010100010010110110001111001000010011011011101100011101100110111000100001011110011001100011111110111011110010110011101000001000010000...
output:
100011001011001101010101001101000111010111001111000010010000011100100110100110110001100100100011000011101101101101010101100110010010010111110111001000011100110111000001111011100010001000110111001110000010000110001111101111010111011110111111111000010111001001011011101100101110110001000110110010101101...
input:
3 4 997 3 2 0 000001111101111110101011111001010001000010111000001100100110001000110001111100001101011101011010001111110111111000011001010110101111011000101100000110010011100010100001101010111110100000000100110010101100111011001100111010101100011100111111001001010111110001001101001011010011101010010...
output:
iunty23v7itdhugh3c000101110101001010101011011011110010011110101010100100010001010001101111100110101100111010110011111100001010001001110001011001011110101100111001110101100110111101010001001011011000111100100001001101101110110001110110011011100010000101111001100110001111111011101111001011001110100000...
result:
ok
Test #13:
score: 30
Accepted
time: 2ms
memory: 3792kb
input:
3 4 997 0100001101100101100011010011101001110110010001101001000010001110001011001011110111010111000000001000011010110101001011111100010111011100000000001011110010101000000110010001001110111011001011001101010001010001001111110111110100100000011000001111001111110011111100110111100101010101010010100011...
output:
101010001011110001100011011001001100110101101000011100110110111100100111111111000111010000000011101110111000101001001101111111101011101111011110000100001100101001101100111001110111001111101011001111101010001001010011110000010111110100110101110100000000001000101001110100110010010011111111100101110100...
input:
3 4 997 3 2 1 100111000111100110000010111010001011101100100000110110100001101000000001111100100001010111101001010100111111111001011101010101111010100010000000110000001000101000011101101100001110101100001010100101101100010101111001010111000110000100011011110011001110110001010110100110001110000111011...
output:
iunty23v7itdhugh3c010000110110010110001101001110100111011001000110100100001000111000101100101111011101011100000000100001101011010100101111110001011101110000000000101111001010100000011001000100111011101100101100110101000101000100111111011111010010000001100000111100111111001111110011011110010101010101...
result:
ok
Test #14:
score: 30
Accepted
time: 2ms
memory: 3788kb
input:
3 4 997 0011010111000101010101000111000101111000010101010100011001010110001001101010110100110110001010001001100010001110011111111000111101001000010010100101001101111001111001101100010000011101000011100010011000111110001101011011011001100111111100111101001011100010011000101010100110100111010000000000...
output:
000100110101110001100000000000100010111110111111110111000111111001100000000011001110010111011000111101101001010000001111101101100100100011010111110111001100101110101101011000111111010010100111101110010101011101100000101011000000111110001001100110000011000000101101101010110110101011011001011110110110...
input:
3 4 997 0 2 1 000100110101110001100000000000100010111110111111110111000111111001100000000011001110010111011000111101101001010000001111101101100100100011010111110111001100101110101101011000111111010010100111101110010101011101100000101011000000111110001001100110000011000000101101101010110110101011011...
output:
iunty23v7itdhugh3c001101011100010101010100011100010111100001010101010001100101011000100110101011010011011000101000100110001000111001111111100011110100100001001010010100110111100111100110110001000001110100001110001001100011111000110101101101100110011111110011110100101110001001100010101010011010011101...
result:
ok
Test #15:
score: 30
Accepted
time: 2ms
memory: 3676kb
input:
3 4 997 1010101011101110011011110110000110011010001001001100111100011100010100100100010100011100001111111110011011110001010100100010001100110101100100100010100110011011101100111001010000110100000011111110100011000101101111110011001110001000010010111110001110000101011101111010100101011011000011101100...
output:
111011010011100100010111010110111101101110001011111110001010100101111011110011000000000111001110010101011100100010010100111011100010000100100111000110100100011111011101110010000101001100101010001101011111100001001010110100001100010010000011011101100110000111101011010001100001110001100100011001001101...
input:
3 4 997 1 2 3 110101100110010101111101000000010110010110011101001001011001110100001101001000111010101111101110110110101111011001000010100101111011000010111100011100010111101101001110111101000101101110101010001100100000101101010010011111111110111000011111001011111010100011011101001000000111111110110...
output:
iunty23v7itdhugh3c101010101110111001101111011000011001101000100100110011110001110001010010010001010001110000111111111001101111000101010010001000110011010110010010001010011001101110110011100101000011010000001111111010001100010110111111001100111000100001001011111000111000010101110111101010010101101100...
result:
ok
Test #16:
score: 30
Accepted
time: 2ms
memory: 3556kb
input:
3 4 997 1000100101101000001110111001101010100001000101001110111100111101111000101110110001111011010110100010001000001010101111010111101111110101100111100011010001011111101001110001110000100101100111101010110001001000101100100000001011000010001010111000101000100110101011101011001000010101000100100101...
output:
011000100011011110000101101100011000111000111000001000111101100000010111001110000101011011111111111011001111010010011011101101111100001001001100101010101010110101100011101011001000101111111111100101110111100001111110001010000011111101100101011000100011010101011001101000000100100110001000101100110001...
input:
3 4 997 2 0 1 111101010010110101001111010010010101100010101110111011010010111011111101001101111111010111000100010111100100111101011001101100010001100100110110011011010100011011110101000101100000011100001110000101110100010111001000101111011000010000100101010010010111001001011111111101000110100010110...
output:
iunty23v7itdhugh3c100010010110100000111011100110101010000100010100111011110011110111100010111011000111101101011010001000100000101010111101011110111111010110011110001101000101111110100111000111000010010110011110101011000100100010110010000000101100001000101011100010100010011010101110101100100001010100...
result:
ok
Subtask #2:
score: 25
Accepted
Test #17:
score: 25
Accepted
time: 2ms
memory: 3784kb
input:
2 4 998 1000110101101001111010101101100101011111011111110001101110110001010100000011001110011111100010010001111100001111001111100100110011100000100010100101001001000001010010110010010110111000001001100110011110101010100101000010110100100110001011000100011111011010101100010001110110010110101111011011...
output:
101001001101100000011101101111100000010100011000100100010111100011001001001110101011110011101101011101010010111011011100101110011110101000011110111011110101100001011001010000101000011111001100110100100111100110111101010011100010110011101011101111100111110100111010110010101101111111100001110101011011...
input:
2 4 998 0 1 10100100110110000001110110111110000001010001100010010001011110001100100100111010101111001110110101110101001011101101110010111001111010100001111011101111010110000101100101000010100001111100110011010010011110011011110101001110001011001110101110111110011111010011101011001010110111111110000...
output:
iunty23v7itdhugh3c100011010110100111101010110110010101111101111111000110111011000101010000001100111001111110001001000111110000111100111110010011001110000010001010010100100100000101001011001001011011100000100110011001111010101010010100001011010010011000101100010001111101101010110001000111011001011010...
result:
ok
Test #18:
score: 25
Accepted
time: 2ms
memory: 3688kb
input:
2 4 998 0001000010111001011001110111011101101001100100000110100100111011101101111010100100100000011010001111110111111010111001011111100010000100110011001111001011011110100111010101111000010111001101010100101011101001110111110001011010001000011000010001111101100010111011100100011000100010001111011111...
output:
100011000111111101000000010001111111010011000110011001011100011010100000011110110010001110110100100111001001100110100110100101111111100111110110010110001100111111000001101010000110100111101111110100101100011011110100000110110111100100011101011001101010110110110100111011001101000010100000101000000010...
input:
2 4 998 2 1 10000110100000001010100010100101010011101100100000110011101100000001010100111110101111101000011101111010110010100000101010001011101001101111011100111001001101010101010111000100010001111101101101010010111101001100101011111011110011001011011000001001000111011110101010101000101101010111101...
output:
iunty23v7itdhugh3c000100001011100101100111011101110110100110010000011010010011101110110111101010010010000001101000111111011111101011100101111110001000010011001100111100101101111010011101010111100001011100110101010010101110100111011111000101101000100001100001000111110110001011101110010001100010001000...
result:
ok
Test #19:
score: 25
Accepted
time: 2ms
memory: 3560kb
input:
2 4 998 1001110011001010100001100111001111111011110101001000001100000010001000001011011001110111100001010010111100000100111111111001001011100000001101010110100111100110010000011101001111110100110111110010110011111010000010011100100100001100011111000101110110111001011100010010011010101000001100000111...
output:
000000011001110101111010100100111100110111111000110100100101001111000100010011011010100101101001110001010000000000001100001011001110110101100100110111010110001100011010001010001110100011101001011001010011011111111001010001111100011000111110101010111000111011100111111110000011011010101011100111111000...
input:
2 4 998 2 3 10010111001000010001110100010011110001100000001111000001000010111000011110101010011011010001110011010011001001100001000111110110001011101100010000010101100101110100111010110110110001001111111110110001111101101011100010001000011101101110100001001000001011001010111100101001000001011010010...
output:
iunty23v7itdhugh3c100111001100101010000110011100111111101111010100100000110000001000100000101101100111011110000101001011110000010011111111100100101110000000110101011010011110011001000001110100111111010011011111001011001111101000001001110010010000110001111100010111011011100101110001001001101010100000...
result:
ok
Test #20:
score: 25
Accepted
time: 2ms
memory: 3716kb
input:
2 4 998 1101000100100000000001111110000001100100010010001011011111010001100101100000111010110111110110111001100010111001101010101110110111100001100011111000001100111100001010001101100000111000111001110011101000100100010001111101001010101000010001000001101001100010110001000000101001110111001101111011...
output:
101011000011110001101010111110100001001111111011001011000101111011101001100101001110101001101111010111101011101101101010100101110010000111110111111100010010101001011111010111111111011111100110001100000010001100001110100111001110111101000111010000010100001110011110100111001110010100110010001001001000...
input:
2 4 998 0 3 10101100001111000110101011111010000100111111101100101100010111101110100110010100111010100110111101011110101110110110101010010111001000011111011111110001001010100101111101011111111101111110011000110000001000110000111010011100111011110100011101000001010000111001111010011100111001010011001...
output:
iunty23v7itdhugh3c110100010010000000000111111000000110010001001000101101111101000110010110000011101011011111011011100110001011100110101010111011011110000110001111100000110011110000101000110110000011100011100111001110100010010001000111110100101010100001000100000110100110001011000100000010100111011100...
result:
ok
Test #21:
score: 25
Accepted
time: 0ms
memory: 3792kb
input:
2 4 998 0111000110011000001100100101011010101111101001111001101011001100111001110100111110100101010000111010110001110000010011100110000100000101111000010111011111100011000010001110100100111101110000100100010110011111011001111000100011010101101001011001011101001111011001001010010001111000000101010100...
output:
111000100111000101010111000100001111100101001001010011001011011000001110111111010010110001100011100000010111101010000100001110010110011011101000101001100001100101101010000110101000101101010001000000001111101011111011000010100000100010110000011010010011101011000101100010110100110011011011110101000101...
input:
2 4 998 0 1 11100010011100010101011100010000111110010100100101001100101101100000111011111101001011000110001110000001011110101000010000111001011001101110100010100110000110010110101000011010100010110101000100000000111110101111101100001010000010001011000001101001001110101100010110001011010011001101101...
output:
iunty23v7itdhugh3c011100011001100000110010010101101010111110100111100110101100110011100111010011111010010101000011101011000111000001001110011000010000010111100001011101111110001100001000111010010011110111000010010001011001111101100111100010001101010110100101100101110100111101100100101001000111100000...
result:
ok
Test #22:
score: 25
Accepted
time: 2ms
memory: 3788kb
input:
2 4 998 1101100100011100110000110000011101110101000001000011110111010010110111101110011000100101011011101000000010001011110001111001100100001100101100011101011000110111000001100111100111111110110111011110111110100001100110100000101000110000111111100001110000000011000001001110111010110110001100001110...
output:
100010000001001111000010011010111011110111000111100010110011000000001110100101110001110001111010110101100001000101000111100000010010111111010100110100110101001010101110110010011101001100011000000011010110001011110001000000000011000000001110100001010111010000110010011110110010000010000110110011010101...
input:
2 4 998 1 2 10100111111000101001000010101011100000111101110011001101111010100011010110111010001110100100101000010001100000001000010001110010000000000111100000011110110111011000010110011110111010111101110111011100101000000001100100111000001101001110000110011011101000000101001110000001110110000010111...
output:
iunty23v7itdhugh3c110110010001110011000011000001110111010100000100001111011101001011011110111001100010010101101110100000001000101111000111100110010000110010110001110101100011011100000110011110011111111011011101111011111010000110011010000010100011000011111110000111000000001100000100111011101011011000...
result:
ok
Test #23:
score: 25
Accepted
time: 2ms
memory: 3584kb
input:
2 4 998 0101001010011000010001001000011111001110110001101010100100110101110101011011110000100111101100111000001000101101101111101110011110110010110010111110010000011111010110110010010001111011100011001100110101000001110111100000011111001111000111100001111110011110100001110110010011100011110010101100...
output:
001100101010101100110001010001001000110011111101101111101111111111110011111010010011111011111000001010101011001100011011100100111011011011010001001101111000010100001000011110000111000101010010101011001000100110101111100011110011011010110100010100011110010100011101011111100000000101100100100101000111...
input:
2 4 998 1 3 01111011000011101100111100101001100101111110011011111110010000100111110100000101010111001001111111100001100000101101010001011000111011000010110011110101100010000100110001001101100101010110111111100110100010011100001101010010111110111100100101100110011111100101000101011011000111110110111...
output:
iunty23v7itdhugh3c010100101001100001000100100001111100111011000110101010010011010111010101101111000010011110110011100000100010110110111110111001111011001011001011111001000001111101011011001001000111101110001100110011010100000111011110000001111100111100011110000111111001111010000111011001001110001111...
result:
ok
Test #24:
score: 25
Accepted
time: 2ms
memory: 3804kb
input:
2 4 998 0010110000000110101011100110110010100111000100000111101100101110010101001010111101111011100111111110011101001101000111011111111001011010001011001111111110100001100110010010010111010111111001000011011101100100000011000000010001111100000110011011000010110100010101011100010110010000011101111101...
output:
110000010111010001111000111111110010010111110001111110101010011100011100010101100000110010111110011101100000001011001000110011100000000000001111101010001000001101001111010001011000010011001000000001001011011110000110010010010101101101001001001111010100111011100011001000010110110111101000111100000011...
input:
2 4 998 0 3 11000001011101000111100011111111001001011111000111111010101001110001110001010110000011001011111001110110000000101100100011001110000000000000111110101000100000110100111101000101100001001100100000000100101101111000011001001001010110110100100100111101010011101110001100100001011011011110100...
output:
iunty23v7itdhugh3c001011000000011010101110011011001010011100010000011110110010111001010100101011110111101110011111111001110100110100011101111111100101101000101100111111111010000110011001001001011101011111100100001101110110010000001100000001000111110000011001101100001011010001010101110001011001000001...
result:
ok
Test #25:
score: 25
Accepted
time: 2ms
memory: 3796kb
input:
2 4 998 0100011010100000100111100110001011001011101010111110110110110111010110001110001111110010111011000010000110110111010000111011000000110111000100010100101110000101101101111111111100010010001010111101110111011010101110010000101110100111111001110001000000000000011101100010010010011100000011100011...
output:
100101000011011100110111111011110010110101111100111011111001110001111010101110001111010110111111101010011100001101111111100000001101111000000011010100011101000111101111001010101100010000000010001101000111111010011001110000111000001111111011101001010010001010011011110001101111110011000110100010110001...
input:
2 4 998 1 2 00110000100011111101000100100110011100100111001111010110001001001010010100011101011001010111110110101000011000010010001001000000101111001011000010011110101000111011011010011101111000100110011001011011100100111101011111010110110111000011110111010000100111000010110011100111001000110000111...
output:
iunty23v7itdhugh3c010001101010000010011110011000101100101110101011111011011011011101011000111000111111001011101100001000011011011101000011101100000011011100010001010010111000010110110111111111110001001000101011110111011101101010111001000010111010011111100111000100000000000001110110001001001001110000...
result:
ok
Test #26:
score: 25
Accepted
time: 2ms
memory: 3664kb
input:
2 4 998 1001010100111000100101111111100000011000100110000001110001011111101111001110101000010110000100010111000101011000011100101110000001110010001100000011000110011011101001011000100001101110101111010101000111000001010110101011011100011010100101100001011001110100111110110101111011101011011110011100...
output:
000001100011011010100010100000011100110110011010111000101111110011110100011000110100101001111110001000100001111110010001100111100111001111111100001001001110011010101010101111100011111011100010101001101010101100110011000111010011000001100010101100111101000111111000011101001101000000100111100101111110...
input:
2 4 998 1 0 10011011101001110111101101110101011100000111010110010111101100001011100010011001000111111100011001011101010001100100101101111000010101000001101011011010001110110110111111011110000111101001111010010110000011100100000101000011001100000001000010000101100110100010000000100100110011011011000...
output:
iunty23v7itdhugh3c100101010011100010010111111110000001100010011000000111000101111110111100111010100001011000010001011100010101100001110010111000000111001000110000001100011001101110100101100010000110111010111101010100011100000101011010101101110001101010010110000101100111010011111011010111101110101101...
result:
ok
Test #27:
score: 25
Accepted
time: 2ms
memory: 3712kb
input:
2 4 998 0011001101010001110111010101011111110011001100000000010101010110101100010110000110101101011111010100001001001000101100010001010111111111100000011011110101101101110100110101011000001010011100000111011001010001101011010101001100011000001011010111110111000001100111110000000010100000011111110101...
output:
010100101010001101010100000000011110011001101110101110101110100001011010111001101001000100011100110100100110000110101110111000100001000001001101001100000001111100110110110000001101101101000111000000101000101011010111010100111101010010011101100100010100101111001111001001110010011101100001010010000000...
input:
2 4 998 1 2 10100101101001100110100000010111010111010010101000110011010101010101110101101110101001110000100010110101001001100111111010101101100100000000100101100101011110011011101011000010111100100111010111000100110010110110011110001010100010011011100101010110001110001100010000001111011110010000001...
output:
iunty23v7itdhugh3c001100110101000111011101010101111111001100110000000001010101011010110001011000011010110101111101010000100100100010110001000101011111111110000001101111010110110111010011010101100000101001110000011101100101000110101101010100110001100000101101011111011100000110011111000000001010000001...
result:
ok
Test #28:
score: 25
Accepted
time: 2ms
memory: 3792kb
input:
2 4 998 1110010011101001101110001110111110010111000100010010100100110000000011101000010001100111001101110001010011001100110011000000010111001011000010100001110110111110100100111100000100111111010011001101010101111001110000111101111110100111000111000011100001011110111010001111111010110001000101100011...
output:
111011001110110100111010110001000011101001110111101000000000000000110001101011110001001001011000100011000001100101111000011000111110011111101001010100010101100000100100111011110001110101111001011101110010111110100001000001101011001111010111001110100100001001000000101000110111000101100010000000001101...
input:
2 4 998 3 2 11011110101011111001000000100000001110010101000100011111111100011110001000111011100011000011011111010110110011111001001100100111111011111000000100111110101010000001011011101111000110110110000010100010010001001001100000100100000001111110101011110110101110110010011000111001000010011110101...
output:
iunty23v7itdhugh3c111001001110100110111000111011111001011100010001001010010011000000001110100001000110011100110111000101001100110011001100000001011100101100001010000111011011111010010011110000010011111101001100110101010111100111000011110111111010011100011100001110000101111011101000111111101011000100...
result:
ok
Test #29:
score: 25
Accepted
time: 2ms
memory: 3784kb
input:
2 4 998 1011100001101001110011011001100111100001100010110111001101110001100000001101110110011111110111101000111110110010101010111000110100010010101000111001001110011100111110111001110001100001101011100110001010101101011111110111101000010110010110100000101111010011101101001001010001101010001000100000...
output:
111001000010000011101011110111101000101000011011100111110111101010110101000100000111000001100111011101101101110110010001001110011110001001011111001111001001100100010110011001100110100011011010100101111010110011100010101011010011001001001011010001111100001010011110010111011110001001110110011001001100...
input:
2 4 998 3 1 10100110111110101100101001000100100011111011111110111000101010110000100010001011111010110100101101001011011101100001011000101100100110010110000000101110001110110001111001010011001011000101110100100010011111011100110001010010100010100001001000010111001100100010110001001010010000110011000...
output:
iunty23v7itdhugh3c101110000110100111001101100110011110000110001011011100110111000110000000110111011001111111011110100011111011001010101011100011010001001010100011100100111001110011111011100111000110000110101110011000101010110101111111011110100001011001011010000010111101001110110100100101000110101000...
result:
ok
Test #30:
score: 25
Accepted
time: 2ms
memory: 3860kb
input:
2 4 998 1010111110110101110011101100001110101101111011001110011111011101010011000110101101000010110011110111011000011000110011011010111010010010111011001101001000000000001100001111010011000011101011001100100011111100001010101000101110010000101101100001100101101111010111011010111101111101000100010011...
output:
010111000011000101101100111110101000011110110001110110100010011100111100101100000100011000010100001001001101101100001101100001010010010111101010011011111111011100010100001110010101110111110000101010001000001010101001001011011010111011101100111100111001100100111101110001101101000100011011000000100100...
input:
2 4 998 2 0 11000111011001011111100110001111010110010111010000101000011111101011100111110000010000010101110101000001111100011000011010101000111111000011101001100101010110010011001101110111000001000000001010110001111100111111110101101101110011110100010011000101011100111000001000010001011000011010010...
output:
iunty23v7itdhugh3c101011111011010111001110110000111010110111101100111001111101110101001100011010110100001011001111011101100001100011001101101011101001001011101100110100100000000000110000111101001100001110101100110010001111110000101010100010111001000010110110000110010110111101011101101011110111110100...
result:
ok
Test #31:
score: 25
Accepted
time: 2ms
memory: 3580kb
input:
2 4 998 1111011100000111001010011011100111000110101010110011100010001011100000000111100111010100111101110010111010101000011010110100110110111111011100010111010010111111011110010111100000101001001010110101100010011010101111001100101101100110101010100110110011100110110011011000101011010101001111000111...
output:
011100111100110000010111011010111000110010100111111101100111101011011110111011011100111011001111001000011100001101010101010011010010100110000100111010100101110111111101111100001100101110100011110000100000001011000100110110011110010111101111101000001111110001100010101010111000110101111101010100101000...
input:
2 4 998 1 2 01100010111001101111000110111101110010101000011011000011110100100101100110000101101010111110110101111000011111011111000011110011111011001001101110110110101011011000101101111100110011010110100000010001110110011010010010111101001101111001110001110011100000110111100111111111001111010110010...
output:
iunty23v7itdhugh3c111101110000011100101001101110011100011010101011001110001000101110000000011110011101010011110111001011101010100001101011010011011011111101110001011101001011111101111001011110000010100100101011010110001001101010111100110010110110011010101010011011001110011011001101100010101101010100...
result:
ok
Test #32:
score: 25
Accepted
time: 2ms
memory: 3784kb
input:
2 4 998 0101111101110111010110101011011001101001100011010100101010001000110101100000001100111100000001111100100010110101101101101010100101000101101010110111010010100101111101011010101110000111111000011110101100110101001010011011000010100111111111000110011000010110101000010011101100010000001111000111...
output:
000111110001110101001010100110101001000101000011001011001101010010000111111001000100011110111110111101001100110001110100010110010110011110000100111010100011000110010011000110011000000111111110001101011100101011010010111011111011101010100111010100000111111001111100011000110011111001011011000010010011...
input:
2 4 998 0 3 00011111000111010100101010011010100100010100001100101100110101001000011111100100010001111011111011110100110011000111010001011001011001111000010011101010001100011001001100011001100000011111111000110101110010101101001011101111101110101010011101010000011111100111110001100011001111100101101...
output:
iunty23v7itdhugh3c010111110111011101011010101101100110100110001101010010101000100011010110000000110011110000000111110010001011010110110110101010010100010110101011011101001010010111110101101010111000011111100001111010110011010100101001101100001010011111111100011001100001011010100001001110110001000000...
result:
ok
Subtask #3:
score: 20
Accepted
Test #33:
score: 20
Accepted
time: 2ms
memory: 3556kb
input:
2 4 997 1000111101100000111001101001001101111101000100111100010101001010000011001110101111010111111001111000010001111010001011111101101010100011101100001000000000100110000000011110101111100000111000011000011000111110011101000000011000110001001111000100110101001101111000101000101001001010001101011000...
output:
100101001101000111101001000010010000111110111111101011011101100101011100100011010010111111001110100101111110000101100100101010101111100110010100100101101101111010011101111010011101100011101000011011100111011001000011110101101100100010000100110011111111001101001011010000010111100110100101100010100101...
input:
2 4 997 3 0 10110100110110000111000011010110001111101101110110010110001111101000100010000001000011101100110010010011010100010000001101110111110010100110000110100111111110100111101011000001000110100101011000100101110100100100010101110011100110001011110001110100000110100001001000111000000111011110101...
output:
iunty23v7itdhugh3c100011110110000011100110100100110111110100010011110001010100101000001100111010111101011111100111100001000111101000101111110110101010001110110000100000000010011000000001111010111110000011100001100001100011111001110100000001100011000100111100010011010100110111100010100010100100101000...
result:
ok
Test #34:
score: 20
Accepted
time: 2ms
memory: 3660kb
input:
2 4 997 0111011000100010100011000000000111011100111011000010100011000100101011001110011111110100100101011111001001011011011001001100111101010101000001110011010101100101111000001001101010000100110011100001101001111011000101001110001001010000100111011011001010010011101001010101011100011110011000111101...
output:
110111111000001010001100111000100100111101100000011100110110000100000011010001001100000110100011100111111010111100000010111100010100001110110101101000111100110000011010010011110111110111011110010111001101111000010111111000110100010001000001100110101010100101000100000100100111001110111001111111000110...
input:
2 4 997 3 2 01010000101100001111111100101101101111011101100111000110010111110101000100010101110010101001111100100110000111000100101110001000100101010011010011010000001101110101110101110011101111100111111001110001010100001100010000010010001100000011110110000010110100000000111101101100011010110010010...
output:
iunty23v7itdhugh3c011101100010001010001100000000011101110011101100001010001100010010101100111001111111010010010101111100100101101101100100110011110101010100000111001101010110010111100000100110101000010011001110000110100111101100010100111000100101000010011101101100101001001110100101010101110001111001...
result:
ok
Test #35:
score: 20
Accepted
time: 2ms
memory: 3552kb
input:
2 4 997 0110101110110010111001101011001010010100001110010100110011110101000001001111011100010010111110001101011010011100000010100011011011001000000000100101101110110000000011101001011110101001100101100101001100111100111000011000000100000111001110100001100101010111011111100010111011010110111100110011...
output:
011111111101111100100100100001000010011110110110100100000001010100100011001111000011001101000001000101001110101000110101100000111111111110010101011111111110001111101110000111110001101111010010101011000011101001000111110011010101001110111000100110001001011110101010011100001111010110000000010101111100...
input:
2 4 997 1 2 11010111001101111000101000110101000001100111011110111011000010111111001101010100000010100010101101101011000111010010100001100110100011001011011010010111101100101011010010011101101111110010111111010001001001011111001101011101101101101101010101001100100010100101001001000000110010110111001...
output:
iunty23v7itdhugh3c011010111011001011100110101100101001010000111001010011001111010100000100111101110001001011111000110101101001110000001010001101101100100000000010010110111011000000001110100101111010100110010110010100110011110011100001100000010000011100111010000110010101011101111110001011101101011011...
result:
ok
Test #36:
score: 20
Accepted
time: 2ms
memory: 3600kb
input:
2 4 997 1101111111010010000111101101000111110010000000000000010110011000010111001111011001011100110101011100011110010001100100100010000111101101011110100100011011111101000000101101101000111101100110110100111011101000101000000000110111000100000100010010101001101010001011110011000001111100010001110100...
output:
100110111011101001110000000000100000010100001000001100100011111011101101100101100011100101100011101111100100001000101010110101011101010011001011100010100101101000010111100001011010100101011000011001001001010100000111111100101010101111101101010010100111001110011000000111110010010000111010111011011000...
input:
2 4 997 0 3 10011011101110100111000000000010000001010000100000110010001111101110110110010110001110010110001110111110010000100010101011010101110101001100101110001010010110100001011110000101101010010101100001100100100101010000011111110010101010111110110101001010011100111001100000011111001001000011101...
output:
iunty23v7itdhugh3c110111111101001000011110110100011111001000000000000001011001100001011100111101100101110011010101110001111001000110010010001000011110110101111010010001101111110100000010110110100011110110011011010011101110100010100000000011011100010000010001001010100110101000101111001100000111110001...
result:
ok
Test #37:
score: 20
Accepted
time: 2ms
memory: 3676kb
input:
2 4 997 1101101000100010111011100011011001111111001110011010111011110010100010110111100100010111011100110011001011011001110111101110100101100010101111010011110010010001000101000011001000101110001100011000100110000001100010101001010010001110011100100000100010001100101010101011010000100111110001111011...
output:
100111111111010111010100011101111011110010111101011110001011110001111110010000101010011111110110100010101001001010111111001010000101111011110011111011101101110101010100001111000011000011001101011111010011011000000000011011001101000011110010010100101000011011001101110001111010001001011110101111001110...
input:
2 4 997 1 2 10001111000010111001101000000111110110100110101010111010100000101111011010111001010010111100100111101101110010001100101100111111000001001110111001000000001100111001011101100100111001100100101001110000011110010000011100001101000010101000110101110001110101100001110101111000011001110001101...
output:
iunty23v7itdhugh3c110110100010001011101110001101100111111100111001101011101111001010001011011110010001011101110011001100101101100111011110111010010110001010111101001111001001000100010100001100100010111000110001100010011000000110001010100101001000111001110010000010001000110010101010101101000010011111...
result:
ok
Test #38:
score: 20
Accepted
time: 0ms
memory: 3804kb
input:
2 4 997 0000000011011010010000111011010010000111100000000101010101101000010111000111110110001010010010000010100000100010100111001000111011111101000110111100001110111000111110100110010100101100000011000011100011010001100110101000000111000111101011100000010001011101101100010110001111001000000110100000...
output:
000010011001111010111000000001100000111010011010111011110000101101101011000111100101010011000000011010100001101000110111001000101110010100101001001001110001011111110011111101111010100100010010000011010010010011100111110100001101000000000101111010010100000101011010011000100010100110111110001110110110...
input:
2 4 997 3 2 00001110010010011001100001010110011101111010011000100000101110111111001011001010111001010011001100101100101010001101101100010111100001001110001000001101001110010011101000001111111111010100010110000111001111100101001010000011111100110001101000100110011001100001000011011010110010100001111...
output:
iunty23v7itdhugh3c000000001101101001000011101101001000011110000000010101010110100001011100011111011000101001001000001010000010001010011100100011101111110100011011110000111011100011111010011001010010110000001100001110001101000110011010100000011100011110101110000001000101110110110001011000111100100000...
result:
ok
Test #39:
score: 20
Accepted
time: 2ms
memory: 3660kb
input:
2 4 997 1101010001001001111111101011110101100100110111010011011100101101000101101010010101001111100110110010110001000011100111000110101111100001011110110100010100110001010011001101011100001101100100010001111110100110010000110000010000101111000101110011010110111100000100100000100011111010110111011001...
output:
101010000111111001101010011111101001010010010011110010010000011111101111100001101000101100100010100101011001001011011011010011001011001001011010001110100011011000100101011110001000110011110010100011000000010101011100110001010111110011001111011111110101100010111010001011000001100111110000001010011011...
input:
2 4 997 3 2 11010110111110110101111100010011000110010111101000110100101101101100011001010000011111010011100000111001010000010011000100011011000000101110111110100110011010101010001100100011000100111001100110110100010101000001100111011110011010011011101110110110111011000101011111111110111110001101111...
output:
iunty23v7itdhugh3c110101000100100111111110101111010110010011011101001101110010110100010110101001010100111110011011001011000100001110011100011010111110000101111011010001010011000101001100110101110000110110010001000111111010011001000011000001000010111100010111001101011011110000010010000010001111101011...
result:
ok
Test #40:
score: 20
Accepted
time: 2ms
memory: 3668kb
input:
2 4 997 0011011100011111000100000010001010000010110011001110111001010100011011111011110010110010101010001100011000010111101011100100101110100100100100011110001101000011011000011111010011000100001100000100101010000000100000010111011101111111011100011110111011101110001011010010011000100110111110001111...
output:
011110011000111110110000111100100101110011110110000110110111101101100010110110010110011000100100100110001010111111011110111111111110110111010110011100111000101010111111100011111110111111100001100000010011011011100111010111011100010011110000110101110001010010001101101101100001110100010100100110100001...
input:
2 4 997 0 2 01111001100011111011000011110010010111001111011000011011011110110110001011011001011001100010010010011000101011111101111011111111111011011101011001110011100010101011111110001111111011111110000110000001001101101110011101011101110001001111000011010111000101001000110110110110000111010001010...
output:
iunty23v7itdhugh3c001101110001111100010000001000101000001011001100111011100101010001101111101111001011001010101000110001100001011110101110010010111010010010010001111000110100001101100001111101001100010000110000010010101000000010000001011101110111111101110001111011101110111000101101001001100010011011...
result:
ok
Test #41:
score: 20
Accepted
time: 2ms
memory: 3792kb
input:
2 4 997 0010010101111001011101001101011100001111011011000001100110000011100111111011001101100101110010100000010100100000111100010011011110011101011110001101011110111110100011100010000011110011011011001101001101010100111101101100110011001011000110010010010101110010010101000010011111011101010001011100...
output:
110011001110101100010100100010010001110101000001000011000110011100101110101111111011110001010100100100100101000000111000110011110010111110101000001011100010110010000101110000011010100001101010000110110101110010101100100011111010100111001000100001110001111000111000101011001011111010110101101011100110...
input:
2 4 997 0 1 11001100111010110001010010001001000111010100000100001100011001110010111010111111101111000101010010010010010100000011100011001111001011111010100000101110001011001000010111000001101010000110101000011011010111001010110010001111101010011100100010000111000111100011100010101100101111101011010...
output:
iunty23v7itdhugh3c001001010111100101110100110101110000111101101100000110011000001110011111101100110110010111001010000001010010000011110001001101111001110101111000110101111011111010001110001000001111001101101100110100110101010011110110110011001100101100011001001001010111001001010100001001111101110101...
result:
ok
Test #42:
score: 20
Accepted
time: 2ms
memory: 3672kb
input:
2 4 997 0110110001101000000110100001101110000011010000011001100010110111010110111110011001111010001011011100011011110101111010000111101110000110100100010001101101011000101011101011001011001011010100101110011010111110011001100110111110000010011101010011000110000101001100000000011001101110001111000010...
output:
010001101001101110011010001011110011110111011110000101001110111110010010101100100111111100110011110111110101010110111100011010000100000101110100110110000011111000011110011100111010100100111110100100100100011101001010011011000001110000000110000101111110001111010111011101100101110001110100110100000001...
input:
2 4 997 0 2 01000110100110111001101000101111001111011101111000010100111011111001001010110010011111110011001111011111010101011011110001101000010000010111010011011000001111100001111001110011101010010011111010010010010001110100101001101100000111000000011000010111111000111101011101110110010111000111010...
output:
iunty23v7itdhugh3c011011000110100000011010000110111000001101000001100110001011011101011011111001100111101000101101110001101111010111101000011110111000011010010001000110110101100010101110101100101100101101010010111001101011111001100110011011111000001001110101001100011000010100110000000001100110111000...
result:
ok
Test #43:
score: 20
Accepted
time: 2ms
memory: 3716kb
input:
2 4 997 1100110011100011111100010110000110010010111100000110010000001110101110101111101100010100111110100100001101010110101000110000101100001101001101011100110110110011010011011000000101101101011010101000000010110001101111000011011001101001011010111101010111100011000000011011111101010100110100010111...
output:
000011010110011000110100011000111101011110100101100100010101001100100100001011011010101001100101100011101100010101000111100011010010110100101010110101011001011001011100010111100000101001011001010000101101100101111010101001100001001001110000011101101010000110110101000000010011100010000000010110010011...
input:
2 4 997 1 0 11110010010111011011010011000000010001010100010000100111001000010010100111100110001011011110110011000101011110111110110110010010000101010100100110100111001101111010100101100110110010011001101010101100001000000000101001001110001100100101000000100010000011000011001110000000010100100010001...
output:
iunty23v7itdhugh3c110011001110001111110001011000011001001011110000011001000000111010111010111110110001010011111010010000110101011010100011000010110000110100110101110011011011001101001101100000010110110101101010100000001011000110111100001101100110100101101011110101011110001100000001101111110101010011...
result:
ok
Test #44:
score: 20
Accepted
time: 0ms
memory: 3656kb
input:
2 4 997 0001100110100101101101010001010011011001101101101110011001010100000111111100000011111101100111001101101011101011010000100011100011111000111100010110101001100100000100000001110010100010110000011001010110011001100010110011101001010111110001011100111101100000101011011001001011111001111110010000...
output:
100001001100101010001101110100101001000001100000100111111011011001100110010101101000100001110010000000001011010100110000000101000110001101000100001101100100000011111000011111011001110011010111000100111010111000000001010111001110110000001010000010000011100101101111000011001101010010111100000110000001...
input:
2 4 997 1 3 01100001010101001010011100110100010111000110101110000001001110110111010111001100010001110011110110011010110110000110110111011100001010110110011000110110001001010001101001001101011011000110000101001011111110011101101110010010011111111101011011001000111010111010010010101001000110100100111...
output:
iunty23v7itdhugh3c000110011010010110110101000101001101100110110110111001100101010000011111110000001111110110011100110110101110101101000010001110001111100011110001011010100110010000010000000111001010001011000001100101011001100110001011001110100101011111000101110011110110000010101101100100101111100111...
result:
ok
Test #45:
score: 20
Accepted
time: 2ms
memory: 3636kb
input:
2 4 997 0000001000100010000111111000000101110100001001010111001111010100000011110001101101011100101111011100000110001011111000001001111011010100010111010101010000111000010110010010111101110110101000010100001100010000110011101110100110000010000111101100101001000001110111001100000100000100110111100001...
output:
001111111001101011101100110110100001101100001110001010111100001110100010001001100000110111010110100110000011110010111011000110101000001000101011101100101010101110011110011001100000010000011110101100011100011010011010100011001111011001011110111100011000000001101011110101111100001000010011101010111011...
input:
2 4 997 1 0 00111111010111011000110110101000000101010111011011011101000010001000011001001011011011011011000100100100110000101111010011000001101111010000100001100000111101010100001000110100010000010011011001111000001001000010110111010011000111110000010001110011000010010000110101000110000010111011111...
output:
iunty23v7itdhugh3c000000100010001000011111100000010111010000100101011100111101010000001111000110110101110010111101110000011000101111100000100111101101010001011101010101000011100001011001001011110111011010100001010000110001000011001110111010011000001000011110110010100100000111011100110000010000010011...
result:
ok
Test #46:
score: 20
Accepted
time: 2ms
memory: 3740kb
input:
2 4 997 1101111001001011101000011101011010101001010111100000010101101011111010110111000010001010100110001000010011000101110100100111101101011111101111011111010000010001001101110010000110000010010110011001001010111111000010110001011000101110100101001010010111100100011011010011011100010100011111111000...
output:
101110110110100101000011000001111111110010010010101000001011111100011110011010100111111010110000001111010011100111110010010011100110011110101101100000000110101011001000101011101011011010100011110000000011011001001110000110000100111000101001101110110101011101000011100111010100011111011101100100001100...
input:
2 4 997 0 3 10111011011010010100001100000111111111001001001010100000101111110001111001101010011111101011000000111101001110011111001001001110011001111010110110000000011010101100100010101110101101101010001111000000001101100100111000011000010011100010100110111011010101110100001110011101010001111101110...
output:
iunty23v7itdhugh3c110111100100101110100001110101101010100101011110000001010110101111101011011100001000101010011000100001001100010111010010011110110101111110111101111101000001000100110111001000011000001001011001100100101011111100001011000101100010111010010100101001011110010001101101001101110001010001...
result:
ok
Test #47:
score: 20
Accepted
time: 2ms
memory: 3724kb
input:
2 4 997 1100000101010010111011000010010111010110111001101101101111011101110101101110010000011001101011100000001101000110110001000011101010101111010100111111101100000100010101010111101010101011100010000111100011100101110011010111101100010000110010011100101101100101111110001101011100110110000011101010...
output:
001000111100110010011101101110101001111010000111000110010010010101010001011100100000110101111010111011000010111110000000001101000110101101010011010010100010111110010110010100011000001011110110011010110101110010111001011100101011100110001101010100010010010010000110001011001101001101011101100100110111...
input:
2 4 997 0 3 00100011110011001001110110111010100111101000011100011001001001010101000101110010000011010111101011101100001011111000000000110100011010110101001101001010001011111001011001010001100000101111011001101011010111001011100101110010101110011000110101010001001001001000011000101100110100110101110...
output:
iunty23v7itdhugh3c110000010101001011101100001001011101011011100110110110111101110111010110111001000001100110101110000000110100011011000100001110101010111101010011111110110000010001010101011110101010101110001000011110001110010111001101011110110001000011001001110010110110010111111000110101110011011000...
result:
ok
Test #48:
score: 20
Accepted
time: 2ms
memory: 3672kb
input:
2 4 997 0101100101001100100011111011001111111101111100010000101001110111010001101001010001001010001001111000101010000111100000001001010101000110011001001101011111100000100111000010010000001111110011110100001011111001110010110000100011111010110101010110110100100100101111001001010100010011100011101001...
output:
000010001001110101100110000111111001001010011111100110111000000010010110101111000000111000010001101101000011001001011000011011101100000010011011000000011011101100111001011101001010011011010001110010001101110011010000110001001000110001100001000110011101000000010111101010010101110000110100100011001011...
input:
2 4 997 2 3 11100101000001010011001000110000011010010111110000110000000010110110100111001000100111010000010001110010010100000011111110111101010110111001001010110011000000011101100100110111100111100111100000100110111011110001011011100110111110111001101110110011100100101111001100011001101011111101001...
output:
iunty23v7itdhugh3c010110010100110010001111101100111111110111110001000010100111011101000110100101000100101000100111100010101000011110000000100101010100011001100100110101111110000010011100001001000000111111001111010000101111100111001011000010001111101011010101011011010010010010111100100101010001001110...
result:
ok
Subtask #4:
score: 25
Accepted
Test #49:
score: 25
Accepted
time: 2ms
memory: 3632kb
input:
3 5 997 0000010100111001110011100111100000111111111111000110001011000000110110111100110101100100011010000101010000110011111010111000100011100000000111010111111001000001000000110001010101011111001100000110111000100001110111000010010101011100110101111111001010110110111000111101000111010110100100010010...
output:
100010101101101100100101111011101101001100100010011100011011111001000100111111001111011010101111101101101010111101100101000110101100100011001111110011110100010010110100001100110001110011111011000010100001000111110000011111011001111011101110011111011001101100001100100100001011001001111111110010010011...
input:
3 5 997 2 4 1 101000111110100010001000010110011110011111110001011001101111001100111111001101110011000110011010100010100101000000100000000011101011001010001111000011000011111011000100010000111001101010101101110000100101100010000000111010100010010101010100100101000100110101011101110010101111101000010...
output:
iunty23v7itdhugh3c000001010011100111001110011110000011111111111100011000101100000011011011110011010110010001101000010101000011001111101011100010001110000000011101011111100100000100000011000101010101111100110000011011100010000111011100001001010101110011010111111100101011011011100011110100011101011010...
result:
ok
Test #50:
score: 25
Accepted
time: 0ms
memory: 3864kb
input:
3 5 997 1001001000001111111110111011001010001100011010011001011100101010100111000111000001010100100110001111111110111001111111101001110111100010110000100111000000011001001111001011100001000001010101100111111011000010100100111011010111110100110000000001100100001111010111101010110100100100100100011100...
output:
111110101010000001010100001010001010100010110011001011110100101001101000000100001101011111101011010001010001011101111000001011111011101100101110011010101000001100011100110100110001010111110011010110100000111101111001100111010010111111110000000000010000110000111011101001010111101011100101010110011011...
input:
3 5 997 3 1 0 110100101000001100001101010101110010111111100111011111000110011101101010010110000110111000010101001101101000000011010000000001110011000111100101100100001001111010100001010101000001011101011000000111101000000110101111001110010100000010110010111101001101001111100110100101011101010110101...
output:
iunty23v7itdhugh3c100100100000111111111011101100101000110001101001100101110010101010011100011100000101010010011000111111111011100111111110100111011110001011000010011100000001100100111100101110000100000101010110011111101100001010010011101101011111010011000000000110010000111101011110101011010010010010...
result:
ok
Test #51:
score: 25
Accepted
time: 2ms
memory: 3560kb
input:
3 5 997 0110000110001110010110111100100111100010000000100101010101101100011100011010101011100001110100010011111101011100000110010110101011000101111000110111101101000100000001000000100011111001101000000001001011111011111101010111010000010000101110101110111101000011110011100111000110100001000010000000...
output:
000001010111011111100000010101110000101011100010111001001100001100111100101011001010001000110001001110000110101010000000110001010110101110001110011101100001011000110101010001000010100001000100110001100101010010111010100111101010101000101101101111110110111101110010010010111111111001001110001111101101...
input:
3 5 997 1 3 0 101000101000101110101010000101111111010101100101000000011111110101101011001111001100110011010110001000100100111000100111100100000111110110000110000110010010001010000111000001011111011000100111011010111111101110100011111000001100011010110100000101000100001110010011100011001101010000101...
output:
iunty23v7itdhugh3c011000011000111001011011110010011110001000000010010101010110110001110001101010101110000111010001001111110101110000011001011010101100010111100011011110110100010000000100000010001111100110100000000100101111101111110101011101000001000010111010111011110100001111001110011100011010000100...
result:
ok
Test #52:
score: 25
Accepted
time: 2ms
memory: 3556kb
input:
3 5 997 1010101001110111011111001000000000011110111001111100000110100010001101000001111100101010011010010100101001100101110111011110100000001010111110010100001011101110011010011000111100010011011111111100000111001011011010101100110100111111100110100100000000110000010101010101000000110000110100101111...
output:
011010111110101010110110010100001000001000001101010101001000111010000001110000110101101101010110010111110011010010010001010101101110010110001101001010001010010000101111110001111010100101100001000100000100010101101011010010000100001110001001101101100010111001100000101100110111100110011101110010010001...
input:
3 5 997 1 0 4 000000100111110001011000011000001111010000001100000100000110001001110100010001010000111001000011010100011001011111001101011110100101111010110111110000100011010111010000000101110011111101101101110001100111011000010111000100101001110001001000100111001010100000001110000101101000110000101...
output:
iunty23v7itdhugh3c101010100111011101111100100000000001111011100111110000011010001000110100000111110010101001101001010010100110010111011101111010000000101011111001010000101110111001101001100011110001001101111111110000011100101101101010110011010011111110011010010000000011000001010101010100000011000011...
result:
ok
Test #53:
score: 25
Accepted
time: 2ms
memory: 3672kb
input:
3 5 997 1001001101110001011001101100011101010010000011010110000110010000111001100011111100100110101101100111000111101111100100110111110110111100000011100000111001011110110111101000101110010011011000011011001011111111011000101100110011110110000110100100101011110100010001011000000100110001100101111011...
output:
111110000000011100100100000111010011000001011010010110110001110110110100110000111011111011001100101011010110110111110011110000110110001110011100100101110001111100111111000011010011001111110100011111100100011011001011001110101000010111011011011110100100110111011110000011010000110111000111100001101011...
input:
3 5 997 0 1 3 111110000000011100100100000111010011000001011010010110110001110110110100110000111011111011001100101011010110110111110011110000110110001110011100100101110001111100111111000011010011001111110100011111100100011011001011001110101000010111011011011110100100110111011110000011010000110111000...
output:
iunty23v7itdhugh3c100100110111000101100110110001110101001000001101011000011001000011100110001111110010011010110110011100011110111110010011011111011011110000001110000011100101111011011110100010111001001101100001101100101111111101100010110011001111011000011010010010101111010001000101100000010011000110...
result:
ok
Test #54:
score: 25
Accepted
time: 2ms
memory: 3656kb
input:
3 5 997 0110101101011000100011000000111111001000001000010101001011011101110100000101001110011001101011111101101011111111011000010100110100100110110100110010110111100001101011010011010110101111010110111010111111100010100110001110001111000101010101011101100001011101010101110010111001100111110101111001...
output:
110000010111110101001101010100110111010100100100001111001111010111001000111111110110000000000100111000100100011111001001101110000101111010010010010110010001100001000110010011101100100101001101001010110110000110000001010111111011011111111000001011111011110011010000001111000111100110110111110100000100...
input:
3 5 997 2 4 0 100011111000110101100000011110101010100110000010001101100110100011001010010011111011001100100111101110100111000111100011011101100011010100001001011000000110110100110011001100000101111010111001111000111000001100111100000011100110101110110111111010110001110011110011101000000011000011110...
output:
iunty23v7itdhugh3c011010110101100010001100000011111100100000100001010100101101110111010000010100111001100110101111110110101111111101100001010011010010011011010011001011011110000110101101001101011010111101011011101011111110001010011000111000111100010101010101110110000101110101010111001011100110011111...
result:
ok
Test #55:
score: 25
Accepted
time: 2ms
memory: 3720kb
input:
3 5 997 0000100101110000101110001000001101001010110010010001000010011110010101101000111011011111101101001000111001010000110010010100110100100111000010100101001000000000000011101001011001010111010001100111011011100011011100101101011111110011011000101101001110000010010001000101110010110011011001011100...
output:
110011111110111100110110100000101001011100100010011100100101101110011101001011001011110000001101100100100100100111000011100111101101000011110001001010100000000001010110101001101110010010110011010110001010100110001010000100011000110110000100011100101100101100011101000111100101111111101001011111000111...
input:
3 5 997 3 2 0 110011100101001010100111010111010100001010010110000100000000100110010000100000100110101000010000110111000000001101000011010111000011000111000111101001110111100001100101010110011111011011010000100000010011001010110011100111000101100010111101011100001011111100111101100101101110101000001...
output:
iunty23v7itdhugh3c000010010111000010111000100000110100101011001001000100001001111001010110100011101101111110110100100011100101000011001001010011010010011100001010010100100000000000001110100101100101011101000110011101101110001101110010110101111111001101100010110100111000001001000100010111001011001101...
result:
ok
Test #56:
score: 25
Accepted
time: 2ms
memory: 3792kb
input:
3 5 997 1110101000111001100010110010100001100110000111101010010100100011101000101110101111110011000001001100001100110010110110010100111000010000000010010111011001000101000111111101111000110110110100101100000111001001001101101111110100101011110011111001110101000011000111110111001001001000101001101001...
output:
001000001011001100101000001001001011001000010011101101011110011010001101101011001001010100110000010000111111001011001100010101010110000000001001110101000001010011011111001001001010110010000101111100100101011001100000110000111010001111111000100110110110110010001010001101111011010110100000011110000001...
input:
3 5 997 2 3 4 010110001001101111001111011011011101000010010000011001010001000011111010100010010001110111101110001111000011100101111011110000011000100110110111101001011001000010010110111110100101101110110000110001010100000111100111010100101010010111111000001000011110000001000001101001000011111101110...
output:
iunty23v7itdhugh3c111010100011100110001011001010000110011000011110101001010010001110100010111010111111001100000100110000110011001011011001010011100001000000001001011101100100010100011111110111100011011011010010110000011100100100110110111111010010101111001111100111010100001100011111011100100100100010...
result:
ok
Test #57:
score: 25
Accepted
time: 2ms
memory: 3600kb
input:
3 5 997 1000000110001100000001100011101110100011100111110101101101010100001101110011011100110001000111000001010111101000110001111010010110000001111111100110011110100001111001001011001000011100001110111011000110100000100101111100010111110011101001111101100010110111010100111100011111100101111001010000...
output:
110010111000100110000111111100001011100100000100100001111001101010111100000110100100100000000001000011111110111110111111010001001100011001101010011100111000100010000110011011101111000010010101000001001110110011011101110110000100011100011001001100010001011000101100001010001110011100101100110000110010...
input:
3 5 997 2 0 4 111011011101110101000000010101111111011111101100000111100001111100100011010111001000011001001100001001100000000100101011011000111011110011111110100111011100011110010111001000011111110010000001111001100010000011000011111001111001001111110101101010101010110000001001111000000011010100111...
output:
iunty23v7itdhugh3c100000011000110000000110001110111010001110011111010110110101010000110111001101110011000100011100000101011110100011000111101001011000000111111110011001111010000111100100101100100001110000111011101100011010000010010111110001011111001110100111110110001011011101010011110001111110010111...
result:
ok
Test #58:
score: 25
Accepted
time: 2ms
memory: 3724kb
input:
3 5 997 0100101001011010110000011100010101000101111010001000111011101010001110000101111011101000000101110100110100000010000100011000000111100010111101000011000001101001100000101010001001111010101001100000101001010101110100010011111110011100001010110011000101100111011000001000001101111110010001101111...
output:
100111100001001010011011000111000001011111110010011100111010010011010011000110110110101111110111010100110011000100110100100010001101001010110111000010011001110110101010011100100010101111101010011010110100101001111111000100110000001011010101100000011111101110110100111100110001000111000010111100111011...
input:
3 5 997 1 0 2 111111111001011101011111010101010000101101001000111011111100001111110111110001111110000101000010010100111100111010110111111010111110000110101111010000110111100101011011010110000110101100100010101101001010001001011110010000100110100000100111011101111010110010101011110111000101001101101...
output:
iunty23v7itdhugh3c010010100101101011000001110001010100010111101000100011101110101000111000010111101110100000010111010011010000001000010001100000011110001011110100001100000110100110000010101000100111101010100110000010100101010111010001001111111001110000101011001100010110011101100000100000110111111001...
result:
ok
Test #59:
score: 25
Accepted
time: 2ms
memory: 3600kb
input:
3 5 998 0100101100001010100010001011100111000101111000001000101110000001000001101000010110110011111110110100001011011000111100101000101000100010110010010010100000110011010010000011101100001110000101110100110101000010110111101001111011100010101101110001101100010001110100110110011110110101011100011000...
output:
101001010100001100110011010100100100100100000011100111011010110000010011100110111100010010101100100100110100111000111001010110001001010111001100100101101101100001001101101010011100001110101111111110010010011111111011000110000001011110000011101111010010111111001101100100100110101110001011111100101000...
input:
3 5 998 4 1 0 000010101110110100100100110000010100100100000100111101101000101110000111111111100010101001011010101110100110010001110011100110011010100010001011101011000110011010100011000101011101000001101000100001101100010011110111111101111010111101111000110100110110110011100100100101101011110001101...
output:
iunty23v7itdhugh3c010010110000101010001000101110011100010111100000100010111000000100000110100001011011001111111011010000101101100011110010100010100010001011001001001010000011001101001000001110110000111000010111010011010100001011011110100111101110001010110111000110110001000111010011011001111011010101...
result:
ok
Test #60:
score: 25
Accepted
time: 2ms
memory: 3580kb
input:
3 5 998 0101101011010000011010000000110110010100011111011111010011011010110000100111100100010011110001010010101001001111100111000010110100000010000100111110000011011000000110001100000100110000010110011110110100001100101000111110000011010001011011100111100000111011110001010010000011010111001000101011...
output:
100010100110110101111111111100101011000000010100111111001000101010010110111110011101111001110000001100100100100111100001101101101010110101001100101000111111010000001010010101100001011101111001100000001000111111100011110100110101000011101010000011110001100000001010010010011100110000001011110000010111...
input:
3 5 998 2 1 3 011010011000101010011100111001111010001100001010010111101110100011001101010111001110101110011111101000101000000001010110001101110100000010000100111101100011111110101110110110110011010100111001001010001101011000101111100111011110100110010011110010110111110010101101110111001100100111010...
output:
iunty23v7itdhugh3c010110101101000001101000000011011001010001111101111101001101101011000010011110010001001111000101001010100100111110011100001011010000001000010011111000001101100000011000110000010011000001011001111011010000110010100011111000001101000101101110011110000011101111000101001000001101011100...
result:
ok
Test #61:
score: 25
Accepted
time: 2ms
memory: 3672kb
input:
3 5 998 1010010011101101011010000001011111100000001110101101010000111111000100111011101100101110010001000000100001100001001010010010111001001111101100111001000011010100001011110001000001101010111101001110001010111011110100010011110011011010010100011110010001100110010010001001001001100010000010011001...
output:
001000101000000000011100010101001111000000110011111101110011111011111111001100110111100111000111111101110000001110111100101000011011110111110111100011001011010101010100110100100000010110100000001110110010010010100000110001001001101101111110000111110101010001100000011111100111001101111000000010001111...
input:
3 5 998 4 0 3 011011111110001111111110110100010100010101001011000101010100000110000111000101110000011000011000000001100101110010110010011001100000101000000111001001000110010110111110010100010000011111001100111011000000001000100100010010110010000110111011000111101101111100011001000010101111011001111...
output:
iunty23v7itdhugh3c101001001110110101101000000101111110000000111010110101000011111100010011101110110010111001000100000010000110000100101001001011100100111110110011100100001101010000101111000100000110101011110100111000101011101111010001001111001101101001010001111001000110011001001000100100100110001000...
result:
ok
Test #62:
score: 25
Accepted
time: 0ms
memory: 3804kb
input:
3 5 998 1001100110101101010011001110010110010000011111010100000011110001000100101011010000000011111001100101101001010010010000110011101010000100111010001000011111101011101101100110110100011011010011101011110000100100001100001001000111100100010000001111111010001011100110101101100010111111011011110110...
output:
001100010110100101000010000000001001110110100010010001010111001011110110111111001010011101000111001011110010010011010001110011011101010010000001001101100110010010101101010001000101001111111011110110101011110110000111000000000001111010011001100111010101000010001010011010001101010000110100010001101001...
input:
3 5 998 1 0 4 110111110001110100110111010011111011010000110011100101111011010010110001000011001011010111100110100011101111011101000100111000010100011111111000101111011011100001011011010100010001000110100000111001010100100000001001010111111100111101100110111100010100001100101000101111100001111110011...
output:
iunty23v7itdhugh3c100110011010110101001100111001011001000001111101010000001111000100010010101101000000001111100110010110100101001001000011001110101000010011101000100001111110101110110110011011010001101101001110101111000010010000110000100100011110010001000000111111101000101110011010110110001011111101...
result:
ok
Test #63:
score: 25
Accepted
time: 2ms
memory: 3708kb
input:
3 5 998 1100110010010001001111100001101100110111110101011001000111111100010001000000111101001110011000110101101001011110100001110000001011011011111001100000111110001100101011001110100110110101000010010000111001011000011010100110000110110110010000001110100110011001010101110001011010100011011100011100...
output:
111100001111011111010000011001101001000100001100011101100001011101010101000110000010010010011100100011110001010100011000100011010110111100011100111111111011001111101010111001110000100000010011110000101100101101000100010111100001111001000100101110001111110100100000011011010100111001110011110001101100...
input:
3 5 998 2 3 0 010001000101011110010101101011010100011100101010100111000100010010000101100000000100001111010101110110110011011111000011011011111111001011110101100110010101110010100010011010110010000111000110101001100101010101100111111110001100011101101110001000111100011001010000111001010101100101101...
output:
iunty23v7itdhugh3c110011001001000100111110000110110011011111010101100100011111110001000100000011110100111001100011010110100101111010000111000000101101101111100110000011111000110010101100111010011011010100001001000011100101100001101010011000011011011001000000111010011001100101010111000101101010001101...
result:
ok
Test #64:
score: 25
Accepted
time: 2ms
memory: 3660kb
input:
3 5 998 0111101010101011001000111010110001101010111001101001111101011100010010001101011110110100111111101111011100010111111111011101111110111101110010100011101100101001011111100100110101011101100100110000001110101010011011010011100111111111110010100000001011110101111110000000011100001011100001111010...
output:
110110101111110010000001001000000100010111101110100101000011010000000000100110100011001110100101011010100111000111100100001000001011100010100100110110100011001101010011001101100101101110001001010100011011111001000100001101010101111111110000111100111110101010110010011111111111011110101010111010100010...
input:
3 5 998 3 2 1 101110010001000011100001101010111100011101100110000000111011101000011101000100100010001011110110111111111010101110101000101111010101100010001001000101000000110001010011111101110001110001100010110110110001010100111000100001000010010010000101110100011010011011011110001000010010001000000...
output:
iunty23v7itdhugh3c011110101010101100100011101011000110101011100110100111110101110001001000110101111011010011111110111101110001011111111101110111111011110111001010001110110010100101111110010011010101110110010011000000111010101001101101001110011111111111001010000000101111010111111000000001110000101110...
result:
ok