QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#78502#5523. Graph Problem With Small $n$maspyAC ✓836ms36012kbC++2014.3kb2023-02-19 10:43:182023-02-19 10:43:21

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-19 10:43:21]
  • 评测
  • 测评结果:AC
  • 用时:836ms
  • 内存:36012kb
  • [2023-02-19 10:43:18]
  • 提交

answer

#line 1 "library/my_template.hpp"
#if defined(LOCAL)
#include <my_template_compiled.hpp>
#else
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using u32 = unsigned int;
using u64 = unsigned long long;
using i128 = __int128;

template <class T>
constexpr T infty = 0;
template <>
constexpr int infty<int> = 1'000'000'000;
template <>
constexpr ll infty<ll> = ll(infty<int>) * infty<int> * 2;
template <>
constexpr u32 infty<u32> = infty<int>;
template <>
constexpr u64 infty<u64> = infty<ll>;
template <>
constexpr i128 infty<i128> = i128(infty<ll>) * infty<ll>;
template <>
constexpr double infty<double> = infty<ll>;
template <>
constexpr long double infty<long double> = infty<ll>;

using pi = pair<ll, ll>;
using vi = vector<ll>;
template <class T>
using vc = vector<T>;
template <class T>
using vvc = vector<vc<T>>;
template <class T>
using vvvc = vector<vvc<T>>;
template <class T>
using vvvvc = vector<vvvc<T>>;
template <class T>
using vvvvvc = vector<vvvvc<T>>;
template <class T>
using pq = priority_queue<T>;
template <class T>
using pqg = priority_queue<T, vector<T>, greater<T>>;

#define vv(type, name, h, ...) \
  vector<vector<type>> name(h, vector<type>(__VA_ARGS__))
#define vvv(type, name, h, w, ...)   \
  vector<vector<vector<type>>> name( \
      h, vector<vector<type>>(w, vector<type>(__VA_ARGS__)))
#define vvvv(type, name, a, b, c, ...)       \
  vector<vector<vector<vector<type>>>> name( \
      a, vector<vector<vector<type>>>(       \
             b, vector<vector<type>>(c, vector<type>(__VA_ARGS__))))

// https://trap.jp/post/1224/
#define FOR1(a) for (ll _ = 0; _ < ll(a); ++_)
#define FOR2(i, a) for (ll i = 0; i < ll(a); ++i)
#define FOR3(i, a, b) for (ll i = a; i < ll(b); ++i)
#define FOR4(i, a, b, c) for (ll i = a; i < ll(b); i += (c))
#define FOR1_R(a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR2_R(i, a) for (ll i = (a)-1; i >= ll(0); --i)
#define FOR3_R(i, a, b) for (ll i = (b)-1; i >= ll(a); --i)
#define overload4(a, b, c, d, e, ...) e
#define overload3(a, b, c, d, ...) d
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FOR_R(...) overload3(__VA_ARGS__, FOR3_R, FOR2_R, FOR1_R)(__VA_ARGS__)

#define FOR_subset(t, s) \
  for (ll t = (s); t >= 0; t = (t == 0 ? -1 : (t - 1) & (s)))
#define all(x) x.begin(), x.end()
#define len(x) ll(x.size())
#define elif else if

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second

#define stoi stoll

int popcnt(int x) { return __builtin_popcount(x); }
int popcnt(u32 x) { return __builtin_popcount(x); }
int popcnt(ll x) { return __builtin_popcountll(x); }
int popcnt(u64 x) { return __builtin_popcountll(x); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 1, 2)
int topbit(int x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(u32 x) { return (x == 0 ? -1 : 31 - __builtin_clz(x)); }
int topbit(ll x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
int topbit(u64 x) { return (x == 0 ? -1 : 63 - __builtin_clzll(x)); }
// (0, 1, 2, 3, 4) -> (-1, 0, 1, 0, 2)
int lowbit(int x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(u32 x) { return (x == 0 ? -1 : __builtin_ctz(x)); }
int lowbit(ll x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }
int lowbit(u64 x) { return (x == 0 ? -1 : __builtin_ctzll(x)); }

template <typename T, typename U>
T ceil(T x, U y) {
  return (x > 0 ? (x + y - 1) / y : x / y);
}
template <typename T, typename U>
T floor(T x, U y) {
  return (x > 0 ? x / y : (x - y + 1) / y);
}
template <typename T, typename U>
pair<T, T> divmod(T x, U y) {
  T q = floor(x, y);
  return {q, x - q * y};
}

template <typename T, typename U>
T SUM(const vector<U> &A) {
  T sum = 0;
  for (auto &&a: A) sum += a;
  return sum;
}

#define MIN(v) *min_element(all(v))
#define MAX(v) *max_element(all(v))
#define LB(c, x) distance((c).begin(), lower_bound(all(c), (x)))
#define UB(c, x) distance((c).begin(), upper_bound(all(c), (x)))
#define UNIQUE(x) \
  sort(all(x)), x.erase(unique(all(x)), x.end()), x.shrink_to_fit()

template <typename T>
T POP(deque<T> &que) {
  T a = que.front();
  que.pop_front();
  return a;
}
template <typename T>
T POP(pq<T> &que) {
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(pqg<T> &que) {
  assert(!que.empty());
  T a = que.top();
  que.pop();
  return a;
}
template <typename T>
T POP(vc<T> &que) {
  assert(!que.empty());
  T a = que.back();
  que.pop_back();
  return a;
}

template <typename F>
ll binary_search(F check, ll ok, ll ng) {
  assert(check(ok));
  while (abs(ok - ng) > 1) {
    auto x = (ng + ok) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
  }
  return ok;
}
template <typename F>
double binary_search_real(F check, double ok, double ng, int iter = 100) {
  FOR(iter) {
    double x = (ok + ng) / 2;
    tie(ok, ng) = (check(x) ? mp(x, ng) : mp(ok, x));
  }
  return (ok + ng) / 2;
}

template <class T, class S>
inline bool chmax(T &a, const S &b) {
  return (a < b ? a = b, 1 : 0);
}
template <class T, class S>
inline bool chmin(T &a, const S &b) {
  return (a > b ? a = b, 1 : 0);
}

// ? は -1
vc<int> s_to_vi(const string &S, char first_char) {
  vc<int> A(S.size());
  FOR(i, S.size()) { A[i] = (S[i] != '?' ? S[i] - first_char : -1); }
  return A;
}

template <typename T, typename U>
vector<T> cumsum(vector<U> &A, int off = 1) {
  int N = A.size();
  vector<T> B(N + 1);
  FOR(i, N) { B[i + 1] = B[i] + A[i]; }
  if (off == 0) B.erase(B.begin());
  return B;
}

// stable sort
template <typename T>
vector<int> argsort(const vector<T> &A) {
  vector<int> ids(len(A));
  iota(all(ids), 0);
  sort(all(ids),
       [&](int i, int j) { return (A[i] == A[j] ? i < j : A[i] < A[j]); });
  return ids;
}

// A[I[0]], A[I[1]], ...
template <typename T>
vc<T> rearrange(const vc<T> &A, const vc<int> &I) {
  vc<T> B(len(I));
  FOR(i, len(I)) B[i] = A[I[i]];
  return B;
}
#endif
#line 1 "library/other/io.hpp"
// based on yosupo's fastio
#include <unistd.h>

namespace fastio {
#define FASTIO
// クラスが read(), print() を持っているかを判定するメタ関数
struct has_write_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.write(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_write : public decltype(has_write_impl::check<T>(std::declval<T>())) {
};

struct has_read_impl {
  template <class T>
  static auto check(T &&x) -> decltype(x.read(), std::true_type{});

  template <class T>
  static auto check(...) -> std::false_type;
};

template <class T>
class has_read : public decltype(has_read_impl::check<T>(std::declval<T>())) {};

struct Scanner {
  FILE *fp;
  char line[(1 << 15) + 1];
  size_t st = 0, ed = 0;
  void reread() {
    memmove(line, line + st, ed - st);
    ed -= st;
    st = 0;
    ed += fread(line + ed, 1, (1 << 15) - ed, fp);
    line[ed] = '\0';
  }
  bool succ() {
    while (true) {
      if (st == ed) {
        reread();
        if (st == ed) return false;
      }
      while (st != ed && isspace(line[st])) st++;
      if (st != ed) break;
    }
    if (ed - st <= 50) {
      bool sep = false;
      for (size_t i = st; i < ed; i++) {
        if (isspace(line[i])) {
          sep = true;
          break;
        }
      }
      if (!sep) reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_same<T, string>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    while (true) {
      size_t sz = 0;
      while (st + sz < ed && !isspace(line[st + sz])) sz++;
      ref.append(line + st, sz);
      st += sz;
      if (!sz || st != ed) break;
      reread();
    }
    return true;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  bool read_single(T &ref) {
    if (!succ()) return false;
    bool neg = false;
    if (line[st] == '-') {
      neg = true;
      st++;
    }
    ref = T(0);
    while (isdigit(line[st])) { ref = 10 * ref + (line[st++] & 0xf); }
    if (neg) ref = -ref;
    return true;
  }
  template <typename T,
            typename enable_if<has_read<T>::value>::type * = nullptr>
  inline bool read_single(T &x) {
    x.read();
    return true;
  }
  bool read_single(double &ref) {
    string s;
    if (!read_single(s)) return false;
    ref = std::stod(s);
    return true;
  }
  bool read_single(char &ref) {
    string s;
    if (!read_single(s) || s.size() != 1) return false;
    ref = s[0];
    return true;
  }
  template <class T>
  bool read_single(vector<T> &ref) {
    for (auto &d: ref) {
      if (!read_single(d)) return false;
    }
    return true;
  }
  template <class T, class U>
  bool read_single(pair<T, U> &p) {
    return (read_single(p.first) && read_single(p.second));
  }
  template <size_t N = 0, typename T>
  void read_single_tuple(T &t) {
    if constexpr (N < std::tuple_size<T>::value) {
      auto &x = std::get<N>(t);
      read_single(x);
      read_single_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool read_single(tuple<T...> &tpl) {
    read_single_tuple(tpl);
    return true;
  }
  void read() {}
  template <class H, class... T>
  void read(H &h, T &... t) {
    bool f = read_single(h);
    assert(f);
    read(t...);
  }
  Scanner(FILE *fp) : fp(fp) {}
};

struct Printer {
  Printer(FILE *_fp) : fp(_fp) {}
  ~Printer() { flush(); }

  static constexpr size_t SIZE = 1 << 15;
  FILE *fp;
  char line[SIZE], small[50];
  size_t pos = 0;
  void flush() {
    fwrite(line, 1, pos, fp);
    pos = 0;
  }
  void write(const char val) {
    if (pos == SIZE) flush();
    line[pos++] = val;
  }
  template <class T, enable_if_t<is_integral<T>::value, int> = 0>
  void write(T val) {
    if (pos > (1 << 15) - 50) flush();
    if (val == 0) {
      write('0');
      return;
    }
    if (val < 0) {
      write('-');
      val = -val; // todo min
    }
    size_t len = 0;
    while (val) {
      small[len++] = char(0x30 | (val % 10));
      val /= 10;
    }
    for (size_t i = 0; i < len; i++) { line[pos + i] = small[len - 1 - i]; }
    pos += len;
  }
  void write(const string s) {
    for (char c: s) write(c);
  }
  void write(const char *s) {
    size_t len = strlen(s);
    for (size_t i = 0; i < len; i++) write(s[i]);
  }
  void write(const double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  void write(const long double x) {
    ostringstream oss;
    oss << fixed << setprecision(15) << x;
    string s = oss.str();
    write(s);
  }
  template <typename T,
            typename enable_if<has_write<T>::value>::type * = nullptr>
  inline void write(T x) {
    x.write();
  }
  template <class T>
  void write(const vector<T> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  template <class T, class U>
  void write(const pair<T, U> val) {
    write(val.first);
    write(' ');
    write(val.second);
  }
  template <size_t N = 0, typename T>
  void write_tuple(const T t) {
    if constexpr (N < std::tuple_size<T>::value) {
      if constexpr (N > 0) { write(' '); }
      const auto x = std::get<N>(t);
      write(x);
      write_tuple<N + 1>(t);
    }
  }
  template <class... T>
  bool write(tuple<T...> tpl) {
    write_tuple(tpl);
    return true;
  }
  template <class T, size_t S>
  void write(const array<T, S> val) {
    auto n = val.size();
    for (size_t i = 0; i < n; i++) {
      if (i) write(' ');
      write(val[i]);
    }
  }
  void write(i128 val) {
    string s;
    bool negative = 0;
    if (val < 0) {
      negative = 1;
      val = -val;
    }
    while (val) {
      s += '0' + int(val % 10);
      val /= 10;
    }
    if (negative) s += "-";
    reverse(all(s));
    if (len(s) == 0) s = "0";
    write(s);
  }
};
Scanner scanner = Scanner(stdin);
Printer printer = Printer(stdout);
void flush() { printer.flush(); }
void print() { printer.write('\n'); }
template <class Head, class... Tail>
void print(Head &&head, Tail &&... tail) {
  printer.write(head);
  if (sizeof...(Tail)) printer.write(' ');
  print(forward<Tail>(tail)...);
}

void read() {}
template <class Head, class... Tail>
void read(Head &head, Tail &... tail) {
  scanner.read(head);
  read(tail...);
}
} // namespace fastio
using fastio::print;
using fastio::flush;
using fastio::read;

#define INT(...)   \
  int __VA_ARGS__; \
  read(__VA_ARGS__)
#define LL(...)   \
  ll __VA_ARGS__; \
  read(__VA_ARGS__)
#define STR(...)      \
  string __VA_ARGS__; \
  read(__VA_ARGS__)
#define CHAR(...)   \
  char __VA_ARGS__; \
  read(__VA_ARGS__)
#define DBL(...)      \
  double __VA_ARGS__; \
  read(__VA_ARGS__)

#define VEC(type, name, size) \
  vector<type> name(size);    \
  read(name)
#define VV(type, name, h, w)                     \
  vector<vector<type>> name(h, vector<type>(w)); \
  read(name)

void YES(bool t = 1) { print(t ? "YES" : "NO"); }
void NO(bool t = 1) { YES(!t); }
void Yes(bool t = 1) { print(t ? "Yes" : "No"); }
void No(bool t = 1) { Yes(!t); }
void yes(bool t = 1) { print(t ? "yes" : "no"); }
void no(bool t = 1) { yes(!t); }
#line 3 "main.cpp"

void solve() {
  LL(N);
  vc<int> nbd(N);
  FOR(i, N) {
    STR(S);
    FOR(j, N) if (S[j] == '1') { nbd[i] |= 1 << j; }
  }
  --N;

  // 使った集合 → 終点としてあるやつ
  vc<int> dp(1 << N);
  FOR(i, N) if (nbd[N] >> i & 1) dp[1 << i] |= 1 << i;
  for (int s = 0; s < (1 << N); ++s) {
    FOR(j, N) {
      int t = s | 1 << j;
      if (s == t) continue;
      if (dp[s] & nbd[j]) dp[t] |= 1 << j;
    }
  }

  // i を始点とするパスの終端
  vc<int> ANS(N + 1);
  FOR(i, N) {
    if (dp.back() >> i & 1) {
      ANS[N] |= 1 << i;
      ANS[i] |= 1 << N;
    }
  }

  FOR(s, 1 << N) {
    FOR(i, N) if (dp[s] >> i & 1) { ANS[i] |= dp[(1 << N) - 1 - s]; }
  }

  FOR(i, N + 1) {
    string x;
    FOR(j, N + 1) x += (ANS[i] >> j & 1 ? '1' : '0');
    print(x);
  }
}

signed main() {
  solve();
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3460kb

input:

4
0110
1010
1101
0010

output:

0001
0001
0000
1100

result:

ok 4 lines

Test #2:

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

input:

6
010001
101000
010100
001010
000101
100010

output:

010001
101000
010100
001010
000101
100010

result:

ok 6 lines

Test #3:

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

input:

4
0111
1011
1101
1110

output:

0111
1011
1101
1110

result:

ok 4 lines

Test #4:

score: 0
Accepted
time: 277ms
memory: 19392kb

input:

23
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #5:

score: 0
Accepted
time: 272ms
memory: 19504kb

input:

23
00010100000000000101000
00000000010000000001000
00000000000001000000001
10000000000000000010000
00000000000000000000000
10000000000000000000000
00000001000000000000000
00000010000000000010000
00000000000001000000000
01000000000000000000000
00000000000000000000000
00000000000000000000000
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #6:

score: 0
Accepted
time: 292ms
memory: 19512kb

input:

23
00001000000000000000000
00001000010001000000000
00000000000101000010000
00001000000100000000000
11010000010011000100000
00000000000100000000000
00000000000000000000001
00000000000000000101000
00000000000000000000000
01001000000000101010010
00000000000000000000101
00110100000010001000000
000010000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #7:

score: 0
Accepted
time: 281ms
memory: 19444kb

input:

23
01000000000001101001100
10000001101000000000000
00000100000100010000100
00000000000000001011000
00000100001000000000000
00101000000000001000001
00000000000000000000000
01000000000000000000000
01000000000100000010000
00000000000001000000011
01001000000000010000000
00100000100001000100001
000000000...

output:

00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
00000000000000000000000
000000000000...

result:

ok 23 lines

Test #8:

score: 0
Accepted
time: 303ms
memory: 19496kb

input:

23
00000000010001001001010
00100010001101110000001
01000001000100110000000
00000011010001101100100
00000000010000010001000
00000000000000001001000
01010001000000000000001
00110010000000000000010
00000000011000100100000
10011000101000100000000
01000000110010101010000
01100000000000000000000
000000000...

output:

01111111110111110110111
10011111110111110110111
10011111110111110110111
11101111110110110110111
11110111110111110110111
11111011110111111111111
11111101110111110110111
11111110110111110110111
11111111010111110110111
11111111100110100110111
00000000000010000010100
11111111110011110110111
111111111111...

result:

ok 23 lines

Test #9:

score: 0
Accepted
time: 298ms
memory: 19468kb

input:

23
00001000001001000000000
00101100111110100000000
01001000100001011010000
00000000010000010010000
11100001100001000000010
01000010101010100011011
00000100000100100010000
00001000011000000010001
01101100000000011001001
01010001000010011000000
11000101000110001100000
01000010001000000000010
010001000...

output:

00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
00000000000000000000100
000000000000...

result:

ok 23 lines

Test #10:

score: 0
Accepted
time: 334ms
memory: 19336kb

input:

23
00001011110010000000001
00000100000011000000100
00010011010100000000011
00100011011001010100100
10000101000110100000000
01001000001010001000100
10110000000110000010000
10111000001100010100010
10000000000010001000110
10110000001110100110001
00010101010100001000000
00101011011000100100011
110011101...

output:

00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
00000000000000000001000
000000000000...

result:

ok 23 lines

Test #11:

score: 0
Accepted
time: 364ms
memory: 19436kb

input:

23
00100100001000000100001
00101110110000100100001
11000000000101001000100
00000000010000001111010
01000011010001011001010
11000000010100001001011
01001000001010101000100
00001000001010000000000
01000000000001100001011
01011100001101100000000
10000011010010100000010
00100100010000000001000
000000110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #12:

score: 0
Accepted
time: 397ms
memory: 19448kb

input:

23
00000001011001011100100
00000001010000000010100
00000001010010100010000
00001000100111100000000
00010100011000010111001
00001000100001000010010
00000001111001100011000
11100010111100110001001
00010111010000101100110
11101011100000100100100
10001011000010100000010
00010001000001011101110
001100000...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #13:

score: 0
Accepted
time: 386ms
memory: 19536kb

input:

23
00100100001101000100000
00010111011000100000010
10000010010001111000010
01001011101001000100000
00010000010110000100111
11000000101000011101001
01110001100000010101100
01010010001001010100000
00010110001100010010001
01101000000011000111000
11010101100010010001101
10001000100010001110100
000010000...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #14:

score: 0
Accepted
time: 426ms
memory: 19604kb

input:

23
01001101001011010101100
10001010111100100001110
00000000010101000111100
00000000001010010100010
11000000100110000111000
10000010001000010101000
01000100100010001100101
10000000010001000110110
01001010000001111100000
01100001000001001101001
11010100000011001010111
01101000000000100100110
100110100...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #15:

score: 0
Accepted
time: 412ms
memory: 19584kb

input:

23
01100101000101001000001
10111000100000010110010
11011010011101000010010
01100010001111011011111
01100010011110001111100
10000000011000001011010
00111001001000101100111
10000010110110011000000
01000001001110010100100
00101101000100111100001
00111110100110011011010
10111001111010001010000
000110011...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #16:

score: 0
Accepted
time: 396ms
memory: 19604kb

input:

23
01111001001110001000101
10000000000100111111110
10010101000110100100101
10101000001010010101001
10010010011110101101111
00100000101100011000000
00001000011000010001101
10100000010000000000100
00000100010110001111100
00001011100101010110111
10011110000000010101101
11101100110010010100000
101110001...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #17:

score: 0
Accepted
time: 404ms
memory: 19552kb

input:

23
01010000000100001110001
10000110010001110010100
00011000101111001010110
10101111011100101100111
00110011111111111011000
01010011100001111011011
01011100001111000011101
00011100001110111010010
00101100011101001000011
01011000100000000000010
00111011100001001000111
10111011100000110100001
001010110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #18:

score: 0
Accepted
time: 400ms
memory: 19500kb

input:

23
00100101011111000101011
00100001000110000111101
11010000011110010110011
00101101110110000101110
00010101111001110101110
10011001111101010011101
00000000110011000000100
11011100110111001110110
00011111000000100110010
10111111000111101010010
10101100000111111010100
11110101011010101010010
111100110...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #19:

score: 0
Accepted
time: 410ms
memory: 19536kb

input:

23
00100001100011011101011
00111011101101101011001
11001101100100001000111
01001010110101101000010
01110011001111000101111
00100011100000111101010
01011100000110101001100
11101100010110110011000
11110100010010000011010
00010001101011011011011
01001000010001001011111
01111011000010101011101
100010111...

output:

01111111111111111111111
10111111111111111111111
11011111111111111111111
11101111111111111111111
11110111111111111111111
11111011111111111111111
11111101111111111111111
11111110111111111111111
11111111011111111111111
11111111101111111111111
11111111110111111111111
11111111111011111111111
111111111111...

result:

ok 23 lines

Test #20:

score: 0
Accepted
time: 529ms
memory: 35896kb

input:

24
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
0000000000000000000000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #21:

score: 0
Accepted
time: 540ms
memory: 35872kb

input:

24
000000000000100000000000
000000000000000000001000
000000000000000001000000
000000100000000000000000
000000000000000000000001
000000000000000001000000
000100000000100100000000
000000000000000000000000
000000000000000000000000
000000000000010000000000
000000000000000000000000
0000000000000000010000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #22:

score: 0
Accepted
time: 535ms
memory: 35908kb

input:

24
000000000010000010000000
000000010100100000010010
000010010000000000000000
000000010000000001000000
001000000000001000000000
000000000100101000000000
000000000000000000000000
011100000001000000000000
000000000010000000000000
010001000000000010100001
100000001000000101000000
0000000100000000100100...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #23:

score: 0
Accepted
time: 537ms
memory: 35860kb

input:

24
000001001001101000001101
000000000000011000100100
000000000000010000000000
000000010000000000000000
000000000000000000000000
100000010000000110000000
000000000001000000010000
000101000000000010000000
100000000001011100011100
000000000000000000100000
000000000000000010001000
1000001010001000000010...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #24:

score: 0
Accepted
time: 564ms
memory: 35936kb

input:

24
011010010001001000000011
100000000000000111000001
100110000100100100010001
001011000100001000110000
101101000000000111000010
000110110000010000010000
000001000000000000000000
100001000001100001000001
000000000001000000110011
001100000000010000001000
000000000000000100000000
1000000110000010000000...

output:

000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000000010000000000000
000000000000000000000000
000000000000000000000000
000000000000000000000000
000000100000000000000000
000000000000000000000000
...

result:

ok 24 lines

Test #25:

score: 0
Accepted
time: 631ms
memory: 35864kb

input:

24
010001010000000000000100
101011011100001011001100
010101010010000100000000
001001101010000000110010
010000000000000000001010
111100000010001101000100
000100000000010000110000
111000000000000011000001
010100000010000000010100
010000000000000001000001
001101001001100110000001
0000000000100100001000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111110111111
111111111110111111111111
...

result:

ok 24 lines

Test #26:

score: 0
Accepted
time: 773ms
memory: 35816kb

input:

24
010001000001001010000001
100001001110101011001010
000000011000010000000100
000000010000100001110101
000000011001000001100010
110000000000000000011000
000000001000000100011010
001110001010000001110001
011010110000010000001001
010000000000100111100101
010000010000001000000000
1000100000000100101110...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #27:

score: 0
Accepted
time: 755ms
memory: 35868kb

input:

24
010000000000000010000000
100000111000100110000011
000000111110010111000000
000001100001010000001100
000000001000000000110100
000100000100000101101111
011100010111010000110100
011000100010100000100010
011010000011001110000001
001001100010001001000010
001000111100000000100000
0001001010001100001000...

output:

011111111111111111111111
101111111111111101111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #28:

score: 0
Accepted
time: 703ms
memory: 35908kb

input:

24
000100000000010010100000
000000001101000010011011
000000000011000000010000
100010100000100000010000
000100000010110101100001
000000111010100000100101
000101000110000011000000
000001001100101010000011
010001010000000010000101
010000110001011001010000
001011100000010010000011
0110000001000101100101...

output:

011111111111111111111111
101111111111111111011111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #29:

score: 0
Accepted
time: 773ms
memory: 35940kb

input:

24
000000000010110010000001
001010001011101000000110
010001001110000000010000
000000100010000010011101
010001101010010011010100
001010000000011101000010
000110000100101011001111
000000001000110000100000
011010010110000000000000
001000101010001010000100
111110001100100010011101
0100000000001011100000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #30:

score: 0
Accepted
time: 818ms
memory: 35972kb

input:

24
010001111000001000000110
100001111000000110010000
000011000101000101100100
000001111111000110100100
001000001010010000111000
111100100000000001110000
110101011101000000001101
110100101000001011000100
110110110011001000000000
001100100000000011011001
000110001000100101110111
0011001010000110110100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #31:

score: 0
Accepted
time: 836ms
memory: 35840kb

input:

24
010000010100011100001111
101010011110111111001010
010101011011100101111100
001000110000100010011011
010000000001010100001011
001000100000011000111001
000101011011001000001100
111100100011010011010100
011000100001000001111111
110000000011110100100010
011000110101000100001000
0010101111101100010001...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #32:

score: 0
Accepted
time: 776ms
memory: 35872kb

input:

24
001011000000111000011011
000100110101100000000100
100001101100110011000010
010011011110101000000110
100101010000100001011110
101110111100100000011111
011001011000001001110011
010111100001110001000110
001101100001110001011011
011101000010010001000100
000100000100001010110110
0100000110000100100100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #33:

score: 0
Accepted
time: 815ms
memory: 35920kb

input:

24
000010011100100010110100
001011100011110001101010
010001000110100000000111
000001101101011000000111
110000101111000010001111
011100000000011010011000
010110000011100001101010
100000001011101011011101
100110010101101010011010
101110001001010101100101
011010110000011111100000
0101101111000100011011...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #34:

score: 0
Accepted
time: 823ms
memory: 35844kb

input:

24
001101101101001010011100
000010000000011001010101
100011110111100001101011
100011100011110101101100
011100010010001110010110
101100111100000110101100
101101000101011000101101
001011001101010110010101
100001010101110001010110
101001111011110111000000
001110000100011000101101
1011001111001111100101...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #35:

score: 0
Accepted
time: 816ms
memory: 35712kb

input:

24
010010110101111110011001
101100001000000100001010
010010101100010111001100
010011001101001011100111
101100011111101011010101
000100010011010011101011
101000001111101010000101
100011001000011110000111
011110110010101000100011
101110100011000101001001
000011101101010110110100
1001111001101010010000...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #36:

score: 0
Accepted
time: 348ms
memory: 19508kb

input:

23
01111101111011111111001
10111101111011111111111
11011101111011111111001
11101101111011111111001
11110111111111111111101
11111001111011111111001
00001000000100000000100
11111100111011111111001
11111101011011111111001
11111101101011111111001
11111101110011111111001
00001010000000000000100
111111011...

output:

01111111111111111111011
10110101111011111111011
11011111111111111111011
11101111111111111111011
10110111111111111111001
11111011111111111111011
10111101111111111111111
11111110111111111111011
11111111011111111111011
11111111101111111111011
11111111110111111111011
10111111111011111111111
111111111111...

result:

ok 23 lines

Test #37:

score: 0
Accepted
time: 316ms
memory: 19408kb

input:

23
00100000001010010010110
00011111110111101101001
10000000000010000010110
01001111110111101101001
01010111110111101101001
01011011110111101101001
01011101110111101101001
01011110110111101101001
01011111010111101101001
01011111100111111101001
10000000000000010000000
01011111110011101101001
111111111...

output:

00100000001000000010110
00111111111111111111111
11011111101111101111111
01101111111111111111111
01110111111111111111111
01111011111111111111111
01111101111111111111111
01111110111111111111111
01111111011111111111111
01011111101101111101001
11111111110101111111111
01111111111011111111111
011111111001...

result:

ok 23 lines

Test #38:

score: 0
Accepted
time: 285ms
memory: 19400kb

input:

23
00000000000100011000000
00000010001000000011000
00001011010111000000011
00000100100000000101100
00100011010111000000011
00010000100000000101100
01101001011111000011011
00101010010111000000011
00010100000000000101100
00101011000111000000011
01000010000000000011000
10101011010011011000011
001010110...

output:

00101001010111111000011
00111111111011000111011
11001011011111001010011
01000100101000100111100
11100011011111001010011
01010000101000100111100
01101001011011000010011
11101010011111001010011
01010100001000100111100
11101011001111001010011
01111111110011000111011
10101001010011001000011
111010110111...

result:

ok 23 lines

Test #39:

score: 0
Accepted
time: 286ms
memory: 19468kb

input:

23
00000000010100001010010
00011001100010100000001
00000110001011010100100
01001001100010100001001
01010001100010100000001
00100010001011010110100
00100100001011010100100
01011000100010100000001
01011001000010100000001
10000000000100001010010
00100110000011010100100
10000000010000001010010
011111111...

output:

00100110011101011111110
00111011101011110101101
11001111111111110110111
01001001100000100001001
01110011101011110101101
10100010011101010110110
11101101111111110110111
01111010101011110101101
01111011001011110101101
10100110001101011111110
11101111110111110110111
10100110011001011111110
011010111010...

result:

ok 23 lines

Test #40:

score: 0
Accepted
time: 279ms
memory: 19512kb

input:

23
00010100000000001100000
00010000000011000000001
00000011000100010011010
11000100000011001100001
00000100001000000000000
10011000001000001100000
00100001000100010011010
00100010000100010011010
00000000000000100010100
00000000000000010000001
00001100000000000000100
00100011000000010011010
010100000...

output:

01011100000011001100000
10010000010011001100001
00000011110100110011010
11000000000011001100000
10000100101000101100100
10001000000000001100000
00100001110100110011010
00100010110100110011010
00101011001100100011110
01100011000111010001011
00001000100000100000100
00100011110000110011010
110100000100...

result:

ok 23 lines

Test #41:

score: 0
Accepted
time: 279ms
memory: 19480kb

input:

23
00100010100001001001000
00000001000010000000010
10010010110101111011000
00100000010100110010010
00000101001000000000100
00001001001000000000000
10100000100001001001000
01001100001010000000010
10100010000001001001000
00110000000100110010000
00001101000000000000000
00110000010000110010000
010000010...

output:

00100010110101111111001
00010101011110110010010
10000010110101111010000
01000000010110110010010
00000100001000000100100
01001001001010000100100
10100000110101111111001
01000100001010000000000
10100010010101111111001
11110010100111111010010
01001101000010000100100
11110010110011111010010
010101010111...

result:

ok 23 lines

Test #42:

score: 0
Accepted
time: 274ms
memory: 19488kb

input:

23
00000001001000011010000
00001110000100000001011
00000000010000100000100
00000000000011100100000
01000110000100000001011
01001010000100000001011
01001100000100000001011
10000000001000001010000
00000000000010000000001
00100000000000010000000
10000001000100001010000
01001110001000000001011
000100001...

output:

00000001000000011010000
00001111101100001011011
00000000010000000000100
00000000100011100100100
01000111101100001011011
01001011101100001011011
01001101101100001011011
11001110001100011011010
01011110000011000101011
00100000000000010000100
01001111000100001011010
01001111001000001011010
000100001000...

result:

ok 23 lines

Test #43:

score: 0
Accepted
time: 279ms
memory: 19492kb

input:

23
00000000000010000010100
00000011000000010000000
00000101000000100001000
00000000110000000000000
00000000101000101100001
00100001000000100001000
01000001000000000000000
01100110000000100001000
00011000011000000000000
00010000100001000000010
00001000100000000000000
00000000000001000010000
100000000...

output:

00000000000110010010100
00000010000000010000000
00000111000000101101001
00000000111000000000010
00000000001000001100001
00100011000000101101001
01100101000000010001000
00100110000000000001000
00010000001000000000000
00010000000000000000010
00011000100000001100001
10000000000001000010110
100000000000...

result:

ok 23 lines

Test #44:

score: 0
Accepted
time: 271ms
memory: 19384kb

input:

23
00000000100000000001011
00000001000010000010000
00000000000101010100100
00001000010100001000000
00010000010000001000000
00000010000000000101000
00000100000000000101000
01000000000000000010010
10000000000000000000011
00011000001000101000000
00000000010000100000000
00110000000001010100100
010000000...

output:

00000110100000000001001
00000000000010000010000
00011110000101011100100
00101000000101011000100
00110000011101011000100
10100010100001010101101
10100100100001010101101
00000000100000000010011
10000111000000000011011
00001000001000001000000
00001000010010101000000
00111000000001011000100
010000000010...

result:

ok 23 lines

Test #45:

score: 0
Accepted
time: 278ms
memory: 19384kb

input:

23
00100100000001001001010
00000000110100010000000
10000000000000100010000
00001010000000000000001
00010000000000100000001
10000000000001001001010
00010000000010000000000
00000000010000000000100
01000000010100010000000
01000001100100010000100
00000000000000010100010
01000000110000010000000
000000100...

output:

00100100000001001011000
00000001111100010100000
10000100000001001011000
00000010000000000000001
00000000000000100010001
10100000000001001111010
00010000000010000000001
01000000110110000000100
01000001011100010100000
01000001100100000000000
01000000100100010100000
01000001111000010100000
000000110000...

result:

ok 23 lines

Test #46:

score: 0
Accepted
time: 287ms
memory: 19432kb

input:

23
00000001000000100000000
00010100000010000000000
00000010101000010011001
01000100000000000000000
00000001000000001000000
01010000000001000000000
00100000101000010011001
10001000000000100000000
00100010001000010011001
00000000000101000000010
00100010100000010011011
00000000010000000000010
010000000...

output:

00001001000000100100000
00010000000010000100000
00000010101100010011111
01000100000011000100000
10000001000000001000000
00010000000001000000000
00100000101100010011111
10001000000000000000000
00100010001100010011111
00000000000101000000000
00100010100100010001011
00100010111001010001011
010100000000...

result:

ok 23 lines

Test #47:

score: 0
Accepted
time: 274ms
memory: 19512kb

input:

23
00011001001000000010000
00010000000000000000001
00000000000010010000010
11001001001000000000000
10010001001000000000000
00000000000100000000100
00000000000000110000100
10011000001000000000000
00000000010001000000000
00000000100000001000010
10011001000000000000000
00000100000000000100000
001000000...

output:

00001001001000000010000
00011001001000000001001
00000010000010111000010
01001001001000000000000
11010001001000000010000
00000010000100100000100
00100100000010110000100
11011000001000000010000
00000000010001001001000
00000000100000001000000
11011001000000000010000
00000100000000000100000
001000100000...

result:

ok 23 lines

Test #48:

score: 0
Accepted
time: 279ms
memory: 19616kb

input:

23
00010010001000000000000
00000000000000000100001
00001100000000000000000
10001010001000010001000
00110000000000010001000
00100000000001000000000
10010000001000000000000
00000000000000000010110
00000000010000001000000
00000000101000000000000
10010010010000000000000
00000000000000001000001
000000000...

output:

00010010011000010001000
00000000000110100100001
00001100000000010001000
10000010000000010001000
00100000000000010001000
00100000000001000000000
10010000011000010001000
00000000000000100010100
00000000010100001000000
10000010101000000000000
10000010010000000000000
01000000100000001000001
010000000000...

result:

ok 23 lines

Test #49:

score: 0
Accepted
time: 286ms
memory: 19508kb

input:

23
00000100000100000100000
00001000000000000001000
00000000000000001010000
00000001000000001000000
01000000010000000001000
10000000000100000100000
00000000001100000000001
00010000000000011000000
00000000000000000110100
00001000000010000000000
00000010000100000000000
10000110001000000100000
000000000...

output:

00000100101100000100100
00001000010000100001000
00010000000000001010100
00100001000000011000000
01000000010000000000000
10000000101100000100100
00000000001000000000001
00010000000000010000000
10000100000000000100100
01001000000010000000000
10000110000100000000001
10000100001000000000000
000000000100...

result:

ok 23 lines

Test #50:

score: 0
Accepted
time: 288ms
memory: 19604kb

input:

23
00000010000000000000010
00100000000001001000000
01000000000000001010000
00000000100010000000000
00000000000001000001000
00000010000000000000101
10000100000000000000101
00000000001000000000010
00010000000000000000100
00000000000000110001000
00000001000000010000000
00000000000010000110000
000100000...

output:

00000110000000000000011
00001000000001001000000
00000000000000001010000
00000000100010000100000
01000000000001101001000
10000010100000000000101
10000100000000000000001
00000000001000000000010
00010100000000000000101
00000000000000110000000
00000001000000010000000
00000000000000000110000
000100000000...

result:

ok 23 lines

Test #51:

score: 0
Accepted
time: 277ms
memory: 19476kb

input:

23
00100000010000000000010
00100000000000000000001
11000000000000000000010
00000000000000100010000
00000000001000000001000
00000000000000010000100
00000000000001010000001
00000000010010001000000
00000000001100000100000
10000001000000000000000
00001000100000000100000
00000000100000000010000
000000010...

output:

00000000010000000000010
00100010000001000000011
01000000000000000000010
00000000000000100010000
00000000001000000101000
00000010000001010000100
01000100000001010000001
00000000010000001000000
00000000000100000100000
10000001000000001000010
00001000000000000100000
00000000100000000110000
000000000000...

result:

ok 23 lines

Test #52:

score: 0
Accepted
time: 279ms
memory: 19560kb

input:

23
00000000010000000001000
00100000100000000000000
01000000000000000000001
00001100000000000100000
00010000000100000100000
00010010000000000010000
00000100000000000011000
00000000000100001000000
01000000000000000000010
10000000000000010000001
00000000000000000000110
00001001000000000000000
000000000...

output:

00000000010000010001000
00100000100000000000000
01000000000000010000001
00000100000000000110000
00000000000100000100000
00010000000000000110000
00000000000000000011000
00000000000100101000000
01000000000000000000010
10000000000000010000000
00000000000000000000110
00001001000000000100000
000000000000...

result:

ok 23 lines

Test #53:

score: 0
Accepted
time: 280ms
memory: 19608kb

input:

23
00000010000001010000000
00010000000000000100000
00000000010100000000000
01000000000010000000000
00000001000000000001000
00000000000001001000000
10000000000001000000000
00001000000000000000010
00000000001000000000001
00100000000100000010000
00000000100000000000101
00100000010000000100000
000100000...

output:

00000010000000010000000
00010000000000000100000
00000000010100000110000
01000000000010000000000
00000001000000000001000
00000010000001001000000
10000100000001010000000
00001000000000000000010
00000000001000000001101
00100000000000000010000
00000000100000000000100
00100000000000000100000
000100000000...

result:

ok 23 lines

Test #54:

score: 0
Accepted
time: 281ms
memory: 19504kb

input:

23
00000000000010000100000
00001000000000000000100
00010000000000010000000
00100100000000010000000
01000000000000001001000
00010010000000000000000
00000100100000000000000
00000000010000000100000
00000010000010000000000
00000001000100000000000
00000000000000100000001
00000000010000000000010
100000001...

output:

00000000000010000100000
00001000000000000001100
00010100000000011001000
00100100000000000000000
01000000000000000001000
00110010000000000000000
00000100100000000000000
00000000010000000100000
00000010000010000000000
00000001000100000000000
00000000000000100000001
00000000010000000000010
100000001000...

result:

ok 23 lines

Test #55:

score: 0
Accepted
time: 277ms
memory: 19564kb

input:

23
01010000000000000000000
10100000000000000000000
01000000000000000001000
10000000010000000000000
00000000000000000110000
00000000000100010000000
00000000000000010100000
00000000000010000000001
00000000001001000000000
00010000000000100000000
00000000100001000000100
00000100000000000000100
000000010...

output:

01010000000000000000000
10100000000000000000000
01000000000000000001000
10000000010000000000000
00000000000000000110000
00000000000100010000000
00000000000000010100000
00000000000010000000001
00000000001001000000110
00010000000000100000000
00000000100000000000100
00000100000000000000100
000000010000...

result:

ok 23 lines

Test #56:

score: 0
Accepted
time: 306ms
memory: 19504kb

input:

23
01001000000000000000000
10000100000000000000000
00000000100000100000000
00000001000001000000000
10000000000001000000000
01000000000000000100000
00000000000000100000010
00010000001000000000000
00100000010000000000000
00000000100010000000000
00000001000000000000010
00000000000000010001000
000000000...

output:

01001000000000000000000
10000100000000000000000
00000000100000100000000
00000001000001000000000
10000000000001000000000
01000000000000000100000
00000000000000100000010
00010000001000000000000
00100000010000000000000
00000000100010000000000
00000001000000000000010
00000000000000010001000
000000000100...

result:

ok 23 lines

Test #57:

score: 0
Accepted
time: 634ms
memory: 35920kb

input:

24
011101010110111111101110
101101010110111111101110
110101010110111111101110
111001010110111111101110
000000101001000000110001
111100010110111111101110
000010001001000000110001
111101000110111111101110
000010100001000000110001
111101010010111111101110
111101010101111111101110
0000101010100000001100...

output:

011111111111111111111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111111111111
111111110111111111111111
111111111011111111111111
111111111101111111011111
111111111110111111011111
...

result:

ok 24 lines

Test #58:

score: 0
Accepted
time: 668ms
memory: 35848kb

input:

24
000000111000000010000000
001111010111111101111111
010111010111111101111111
011011010111111101111111
011101010111111101111111
011110010111111101111111
100000001000000010000000
111111000111111101111111
100000100000000010000000
011111010011111101111111
011111010101111101111111
0111110101101111011111...

output:

011111111111111001111111
101111111111111111111111
110111111111111111111111
111011111111111111111111
111101111111111111111111
111110111111111111111111
111111011111111111111111
111111101111111001111111
111111110111111111111111
111111111011111111111111
111111111101111111111111
111111111110111111111111
...

result:

ok 24 lines

Test #59:

score: 0
Accepted
time: 575ms
memory: 35948kb

input:

24
010011101111010010010001
100011101111010010010001
000000010000001001000100
000000001000100101101010
110001101111010010010001
110010101111010010010001
110011001111010010010001
001000000010001001000100
110111100111110110010001
110011101011010010010001
110011111101010010010001
1100111011100100100100...

output:

011011111111111110010101
101011111111111110010101
110011110111011011111111
000000000000100100101010
111001111111111110010101
111010111111111110010101
111011011111111110010101
111011100111011010010101
110011100101110110010001
111011111011111110010101
111011110101011010010101
111011111110111110010101
...

result:

ok 24 lines

Test #60:

score: 0
Accepted
time: 557ms
memory: 35980kb

input:

24
000000100000001000101001
001010001101010110010010
010011001101010110010010
000001010000101001000100
011000001101010110010010
001100010000101001000100
100000000000001000101000
000101000000101001000100
011010000101010110010010
011010001001010110010010
000000000000010000000001
0110100011000101100100...

output:

000000100010000000101001
001111011111110111010110
010111011101100111010110
011011111101101111111110
011101011111110111010110
011110011101100111010110
100100010010101001101101
011111101101101111111110
011111010111110111010110
011111011011110111010110
110010101101010110111011
011111011110110111010110
...

result:

ok 24 lines

Test #61:

score: 0
Accepted
time: 556ms
memory: 35892kb

input:

24
001010000100010000010001
000100101000100010001010
100110000100010000010001
011000001000000000000000
101000000110010000010001
000000010010000100000000
010000000000100010001010
000001000010000100000000
010100000000000000000000
101010000000010000010001
000011010000000100000000
0000000000000011011011...

output:

001111011110010000010001
000000101000100010000010
100100001100010000010001
101000001100010000010001
100001010110010000010001
100010010111011101110101
010000001001101011101110
100011000111011101110101
111100100100110010010011
101111011010010000010001
100011010100010000010001
000001110000101111101110
...

result:

ok 24 lines

Test #62:

score: 0
Accepted
time: 533ms
memory: 35976kb

input:

24
001001000001001000000000
000110000000010000110100
100001000101001001010000
010010000000010000110100
010100000000010000110100
101000000001001000000001
000000001010000000101010
000000000000100110000010
000000100010000000001010
001000000000000001010000
000000101000000000001010
1010010000000010000000...

output:

001001000101001001000001
000110101110010001111100
100000000101001001000000
010010101110010001111100
010100101110010001111100
100000000001001000000001
010110001010010000101100
000000001010100110001011
010110110010010110101110
111110000001011001010100
010110111000010110101110
101001000100001001000001
...

result:

ok 24 lines

Test #63:

score: 0
Accepted
time: 536ms
memory: 35980kb

input:

24
000001101000100000000100
000000000100001010000001
000000010001000100111010
000010001000000000000000
000100001000010001000001
100000101000100000000100
100001001010100000000100
001000000000000100001010
100111100000100000000100
010000000000001010000001
000000100000000000010000
0010000000000000001100...

output:

000101101010100000000100
000000010100011111001011
000000010001000100100010
100011001000110001000100
000100000000010001000000
100100101010100000000100
100001000010100000000100
011000000101001110101010
100101000000100000000100
010000010000011111001011
100001100001100000110100
001000010010000100110010
...

result:

ok 24 lines

Test #64:

score: 0
Accepted
time: 532ms
memory: 35816kb

input:

24
000110001100000011000010
000000000001110000000100
000000010010000100010000
100010001100000011100010
100100001100000011000010
000000110000000000001000
000001010000000000001000
001001100000000000001000
100110000100000011000010
100110001000000011000010
001000000000000100010100
0100000000001100000001...

output:

000110001100000011100011
000000000011111100010100
000001110000000100010000
100010001100000011100000
100100001100000011100011
001000110000000100011001
001001010000000100011001
001001100000000100010000
100110000100000011100011
100110001000000011100011
010000000001010100010100
010000000010111100010100
...

result:

ok 24 lines

Test #65:

score: 0
Accepted
time: 531ms
memory: 36012kb

input:

24
011010100011011000110000
101010100011011000110000
110010100011011000110000
000001000100000010001000
111000100011011000110000
000100000100000110000000
111010000011011000110000
000000000000100000001010
000000000000000100000001
000101000000000010000000
111010100001011000110100
1110101000100110001100...

output:

011010100011011000110101
101010100011011000110101
110010100011011000110101
000000010100000010001010
111000100011011000110101
000000000100000110000000
111010000011011000110101
000100000100100011001010
000000000000000100000001
000101010000000110001010
111010100000011000110100
111010100000011000110001
...

result:

ok 24 lines

Test #66:

score: 0
Accepted
time: 530ms
memory: 35948kb

input:

24
000000000000010100000000
000000100000001011010100
000100000000000000000010
001000000000100000001000
000000000100000000000100
000000000000000000000011
010000000000001011010100
000000000111000000000000
000000000001000000101000
000010010011000000000100
000000010101000000000000
0000000111100000001010...

output:

000000000000010100000000
000010100000011011010100
000101000000100000000010
001000000000100000000000
010000110110001001010100
001000000000000100000011
010010000000011011010100
000010001111000000100000
000000010011100000101000
000010010010000000000000
000010011101000000100000
000000011010000000100000
...

result:

ok 24 lines

Test #67:

score: 0
Accepted
time: 529ms
memory: 35884kb

input:

24
000100001000000000000000
000000000010000001000000
000000100001100010000001
100001001000000000000000
000000000000000101000010
000100000010000000000000
001000010001101010010001
000000100000001000010000
100100000000000000101100
000000000000010000010000
010001000000000000000000
0010001000001000100000...

output:

000101001000000000101000
000010000010000001000010
000000110001101010101101
100001000000000000000000
010000000000010101000010
100100000010000000000000
001000010001101000000001
001000100101101000010001
100000000000000000101000
000000010000011000010000
010001000000000000000000
001000110000101010101101
...

result:

ok 24 lines

Test #68:

score: 0
Accepted
time: 535ms
memory: 35980kb

input:

24
000001100000000000000000
000010000001000000010000
000000000000001001000000
000000000010010100000000
010000000000000000010000
100000001000000000001000
100000000000000000000011
000000000100100011100000
000001000000000000001000
000000010000100011100000
000100000000010100000001
0100000000000000100000...

output:

000001101000000000000010
000010000001000000000000
000000010100101001100100
000000000010010100000111
010000001001000000011000
100000001000000000000000
100000000000000000000010
001000000101100011100000
100011000000000000011000
001000010001100011100000
000100000000010000000011
010010010100100010100000
...

result:

ok 24 lines

Test #69:

score: 0
Accepted
time: 532ms
memory: 35916kb

input:

24
000010001000000000000000
000000000011110000000000
000100000100000001000001
001000000100100001010001
100000000001000000000000
000000000000000100001110
000000000000001000000100
000000000000000010100000
100000000000000000100000
001100000000000001000001
010000000000110000000000
0100100000000000000000...

output:

000010001000000000000000
000000000011010000000000
000101000100000101011011
001000000100000001010000
100000000001000000000000
001000100100000101001111
000001000000001100001100
000000000000000010100000
100000000000000000100000
001101000000000101011011
010000000001110000010000
010010000010010000000000
...

result:

ok 24 lines

Test #70:

score: 0
Accepted
time: 537ms
memory: 35912kb

input:

24
000000000001000010100000
001000100000000000000000
010000000000010000000000
000000000000000010000100
000000000001000101010000
000000100000000000001000
010001000000000000000000
000000000000000000001001
000000000110000000000000
000000001010101000000000
000000001100000000010000
1000100000000001111100...

output:

000110000001000111100000
001000100000000000000000
010000000000010000000000
100000000000000010100101
100000001011000101110000
000000100000000000001000
010001000000000000000000
000000000000000000001001
000010000110100101010000
000000001000100000000000
000010001000000101010000
100010000000000101100000
...

result:

ok 24 lines

Test #71:

score: 0
Accepted
time: 528ms
memory: 35944kb

input:

24
000100000100000000001000
000000000000000001001000
000000000010000000100100
100000000100000000000000
000000011000000000000000
000000001001000000010000
000000000011001000000000
000010000000000000000010
000011000001000000010000
100100000000000010000000
001000100001001000000000
0000011010100010000100...

output:

000100000000000000001000
000000000000000001001000
000000100010001000100000
100000000100000010001000
000001011000000000010000
000010101001001000010000
001001000011001000110000
000010000000000000000011
000011000000000000010000
000100000000000010000000
001000100000001000100000
000001100000001000010000
...

result:

ok 24 lines

Test #72:

score: 0
Accepted
time: 532ms
memory: 35884kb

input:

24
000011000000000000000000
000000100000000000000100
000000000100000000100000
000001000000000100000000
100001000000100010000001
100110000000000000000000
010000000000001000100000
000000000000000100000100
000000000000010000010001
001000000010000000000000
000000000101000000000000
0000000000100000000010...

output:

000111000000100010000000
000000100000001000000100
000000000100001000100000
100001000000000100000000
100000000000100010000000
100100000000000000000000
010000000000001000000000
000000000000000100000100
000000000000110011010001
001000000010000000000000
000000000101000000000000
000000000010000000001000
...

result:

ok 24 lines

Test #73:

score: 0
Accepted
time: 537ms
memory: 35816kb

input:

24
000000000000100000100001
000100000010000000000000
000000000000000010001000
010000000000000000000001
000000000001001000000010
000000100100000001000000
000001000010000000000000
000000000000010000001000
000000000000010000010000
000001000000000001000000
010000100000000000000000
0000100000000011000000...

output:

000000000000100000000001
000100000010000000000000
000000010000000010001100
010000000000000000000001
000000000000001000000010
000000100100000000000000
000001000110000000000000
001000000000010000001000
000000000000010000010000
000001100000000101000000
010000100000000000000000
000000000000001100000000
...

result:

ok 24 lines

Test #74:

score: 0
Accepted
time: 527ms
memory: 35944kb

input:

24
000000000000100000001000
000000000010010000000000
000010010000000000000100
000000010000000000100000
001000000000000000000110
000000000100001000000000
000000000000010010000000
001100000000000000100000
000000000000000000001010
000001000000000001000001
010000000000010001000000
0000000000000001001000...

output:

000000000000100000001000
000000100010010001000001
000100010000000000000100
001000010001000000100100
000000000000000000000110
000000000100001000000001
010000000000010010000000
001100000000000000000100
000000000000000000001010
000001000000000000000001
010000000000000001000001
000100000000000100100000
...

result:

ok 24 lines

Test #75:

score: 0
Accepted
time: 527ms
memory: 35852kb

input:

24
000001100000000000000000
000000000010000000000001
000000000000101000000000
000000000010000000001000
000000100000010001000000
100000100100000000000000
100011000000000001000000
000000001000100000000000
000000010000000000000100
000001000001000000000000
010100000000000000000001
0000000001000000000001...

output:

000001100100000001000000
000100000010010000000001
000000000000101000000000
010000000010000000001000
000000000000010001000000
100000000100000000000000
100000000000000001000000
000000001000100000000000
000000010000000000000100
100001000001000000000000
010100000000000000000000
000000000100000000000100
...

result:

ok 24 lines

Test #76:

score: 0
Accepted
time: 528ms
memory: 35860kb

input:

24
000000100000000000001000
001010000000000000000000
010001000000000000000000
000000000111000010000000
010000010000000000000000
001000000000010000000000
100000000000000000000001
000010000000000000000010
000000000000100000000001
000100000011000000000000
000100000101010000000000
0001000001100000000000...

output:

000000100000000000001000
001010000000000000000000
010001000000000000000000
000000000101000010000000
010000010000000000000000
001000000000010000000000
100000000000000000000001
000010000000000000000010
000000000000100000000001
000100000011010010000000
000000000101010000000000
000100000110010010000000
...

result:

ok 24 lines

Test #77:

score: 0
Accepted
time: 526ms
memory: 35904kb

input:

24
010000000000000000100000
101000000000000000000000
010000000000000001000000
000010000001000000000000
000100000000000010000000
000000000000000001000001
000000000000000000000011
000000000000100000001000
000000000010000000000100
000000000010000100000000
000000001100000000000000
0001000000000110000000...

output:

010000000000000000100000
101000000000000000000000
010000000000000001000000
000010000001010000000000
000100000000000010000000
000000000000000001000001
000000000000000000000011
000000000000100000001000
000000000010000000000100
000000000010000100000000
000000001100000000000000
000100000000010000000000
...

result:

ok 24 lines

Test #78:

score: 0
Accepted
time: 545ms
memory: 35908kb

input:

24
000000000000010000010000
000100000000000001000000
000000010000000000000001
010000000000000000000010
000000000000000100100000
000000000100000000000100
000000000001000100000000
001000000000000010000000
000000000100001000000000
000001001000000000000000
000000000000000000010001
0000001000000000010000...

output:

000000000000010000010000
000100000000000001000000
000000010000000000000001
010000000000000000000010
000000000000000100100000
000000000100000000000100
000000000001000100000000
001000000000000010000000
000000000100001000000000
000001001000000000000000
000000000000000000010001
000000100000000001000000
...

result:

ok 24 lines