QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#189614#4920. 挑战分解质因数hos_lyric100 ✓800ms3912kbC++1411.5kb2023-09-27 18:18:132023-09-27 18:18:18

Judging History

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

  • [2023-09-27 18:18:18]
  • 评测
  • 测评结果:100
  • 用时:800ms
  • 内存:3912kb
  • [2023-09-27 18:18:13]
  • 提交

answer

#include <cassert>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

using Int = long long;

template <class T1, class T2> ostream &operator<<(ostream &os, const pair<T1, T2> &a) { return os << "(" << a.first << ", " << a.second << ")"; };
template <class T> ostream &operator<<(ostream &os, const vector<T> &as) { const int sz = as.size(); os << "["; for (int i = 0; i < sz; ++i) { if (i >= 256) { os << ", ..."; break; } if (i > 0) { os << ", "; } os << as[i]; } return os << "]"; }
template <class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cerr << *i << " "; cerr << endl; }
template <class T> bool chmin(T &t, const T &f) { if (t > f) { t = f; return true; } return false; }
template <class T> bool chmax(T &t, const T &f) { if (t < f) { t = f; return true; } return false; }
#define COLOR(s) ("\x1b[" s "m")

////////////////////////////////////////////////////////////////////////////////

#ifndef __x86_64__
#error Only x86-64 targets are supported
#endif
#include<cstdint>
#include<vector>
#include<string>
#include<iosfwd>
#define __builtin_ia32_adc(x,y,flag) __asm__("addb   %3, %0\n\t" "adcq   %2, %1\n\t" "setc   %0":"+r"(flag),"+r"(x):"r"(y),"i"(-1):"cc")

struct bigint{// made by dengyaotriangle!
    typedef unsigned long long u64;
    typedef unsigned __int128 u128;
    typedef std::size_t st;
    std::vector<u64> data;
    bigint(){}
    bigint(u64 x):data(x?std::vector<u64>{x}:std::vector<u64>{}){}
    bigint(const std::string &s){
        st pos=s.length();
        int cnt=0;
        u64 val=0;
        while(pos){
            pos--;
            if(cnt==64){
                data.push_back(val);
                val=0;cnt=0;
            }
            val|=(u64)(s[pos]=='1')<<cnt;
            ++cnt;
        }
        if(cnt&&val)data.push_back(val);
    }
    explicit operator std::string()const{
        if(data.empty())return "0";
        bool t=0;
        std::string ret;
        for(int i=63;i>=0;i--){
            t|=(data.back()>>i)&1;
            if(t)ret+='0'|((data.back()>>i)&1);
        }
        st i=data.size()-1;
        while(i){
            i--;
            for(int j=63;j>=0;j--)ret+='0'|((data[i]>>j)&1);
        }
        return ret;
    }
    explicit operator bool()const{return !data.empty();}
    explicit operator u64()const{return data.empty()?0:data[0];}
    st digit()const{
        if(data.empty())return 0;
        return (data.size()<<6)-__builtin_clzll(data.back());
    }
    bool operator==(const bigint &a)const{return a.data==data;}
    bool operator!=(const bigint &a)const{return a.data!=data;}
    bool operator<(const bigint &a)const{
        if(data.size()!=a.data.size())return data.size()<a.data.size();
        for(st i=data.size();i;){
            i--;
            if(data[i]!=a.data[i])return data[i]<a.data[i];
        }
        return 0;
    }
    bool operator>(const bigint &a)const{return a<(*this);}
    bool operator<=(const bigint &a)const{return !(*this>a);}
    bool operator>=(const bigint &a)const{return !(*this<a);}
    bigint &operator<<=(st n){
        if(data.empty())return *this;
        int w=n&63;st z=n>>6;
        st i=data.size();
        bool flg=0;
        if(w&&(data.back()>>(64-w)))data.push_back(0),flg=1;
        data.resize(data.size()+z);
        while(i){
            i--;
            if(flg)data[i+z+1]|=data[i]>>(64-w);
            data[i+z]=data[i]<<w;
            flg|=bool(w);
        }
        for(st i=0;i<z;i++)data[i]=0;
        return *this;
    }
    bigint &operator>>=(st n){
        int w=n&63;st z=n>>6,i=0;
        for(;i+z<data.size();i++){
            if(w&&i)data[i-1]|=data[i+z]<<(64-w);
            data[i]=data[i+z]>>w;
        }
        while(data.size()>i)data.pop_back();
        while(!data.empty()&&data.back()==0)data.pop_back();
        return *this;
    }
    bigint operator<<(st n)const{return bigint(*this)<<=n;}
    bigint operator>>(st n)const{return bigint(*this)>>=n;}
    bigint &operator+=(const bigint &a){
        data.resize(std::max(data.size(),a.data.size()));
        bool carry=0;
        for(st i=0;i<data.size();i++){
            u64 rg=0;
            if(i<a.data.size())rg=a.data[i];
            __builtin_ia32_adc(data[i],rg,carry);
        }
        if(carry)data.push_back(1);
        return *this;
    }
    bigint &operator-=(const bigint &a){
        bool carry=1;
        for(st i=0;i<data.size();i++){
            u64 rg=-1;
            if(i<a.data.size())rg=~a.data[i];
            __builtin_ia32_adc(data[i],rg,carry);
        }
        while(!data.empty()&&data.back()==0)data.pop_back();
        return *this;
    }
    bigint &operator++(){return *this+=bigint(1);}
    bigint &operator--(){return *this-=bigint(1);}
    bigint operator++(int){bigint tmp=*this;++*this;return tmp;}
    bigint operator--(int){bigint tmp=*this;--*this;return tmp;}
    bigint &operator*=(const bigint &a){
        std::vector<u64> ret(data.size()+a.data.size());
        for(st i=0;i<data.size();i++){
            u64 carry=0;bool wcarry=0;
            st k=i;
            for(st j=0;j<a.data.size();j++,k++){
                u128 r=data[i]*(u128)a.data[j]+carry;
                u64 cur=r;
                carry=r>>64;
                __builtin_ia32_adc(ret[k],cur,wcarry);
            }
            while(carry||wcarry){
                __builtin_ia32_adc(ret[k],carry,wcarry);
                carry=0;k++;
            }
        }
        while(!ret.empty()&&ret.back()==0)ret.pop_back();
        data=ret;
        return *this;
    }
    bigint &operator/=(const bigint &a){
        if(a.digit()>digit()){
            data.clear();
            return *this;
        }
        st z=digit()-a.digit();
        std::vector<u64> ret;
        while(1){
            bigint tmp=a<<z;
            if(tmp<=*this){
                *this-=tmp;
                st v1=z>>6;
                if(ret.size()<=v1)ret.resize(v1+1);
                ret[v1]|=(u64)(1)<<(z&63);
            }
            if(!z)break;
            z--;
        }
        data=ret;
        return *this;
    }
    bigint &operator%=(const bigint &a){
        if(a.digit()>digit())return *this;
        st z=digit()-a.digit();
        while(1){
            bigint tmp=a<<z;
            if(tmp<=*this)*this-=tmp;
            if(!z)break;
            z--;
        }
        return *this;
    }
    bigint operator+(const bigint &a)const{return bigint(*this)+=a;}
    bigint operator-(const bigint &a)const{return bigint(*this)-=a;}
    bigint operator*(const bigint &a)const{return bigint(*this)*=a;}
    bigint operator/(const bigint &a)const{return bigint(*this)/=a;}
    bigint operator%(const bigint &a)const{return bigint(*this)%=a;}
};
std::istream &operator>>(std::istream &st,bigint &a){
    std::string s;st>>s;a=bigint(s);return st;
}
std::ostream &operator<<(std::ostream &st,const bigint &a){
    return st<<(std::string)(a);
}

////////////////////////////////////////////////////////////////////////////////

void swap(bigint &a, bigint &b) {
  a.data.swap(b.data);
}
int bsf(const bigint &a) {
  for (int i = 0; i < (int)a.data.size(); ++i) if (a.data[i]) {
    return i << 6 | __builtin_ctzll(a.data[i]);
  }
  assert(false);
}
bigint gcd(bigint a, bigint b) {
  // return b ? gcd(b, a % b) : a;
  //*
  if (!a) return b;
  if (!b) return a;
  const int s = min(bsf(a), bsf(b));
  a >>= bsf(a);
  do {
    b >>= bsf(b);
    if (a > b) swap(a, b);
    b -= a;
  } while (b);
  return a << s;
  //*/
}
bool isOne(const bigint &a) {
  return (a.digit() == 1 && (unsigned long long)a == 1);
}
int mod(const bigint &a, int m) {
  int b = 0;
  for (int i = (int)a.data.size(); --i >= 0; ) {
    b = ((unsigned __int128)b << 64 | a.data[i]) % m;
  }
  return b;
}

namespace montgomery {
int sz;
bigint m, negInvM, two2;
void init(const bigint &m_) {
  assert(m_);
  assert(m_.data[0] & 1);
  m = m_;
  sz = m.data.size();
  negInvM = 1;
  for (int e = 1; e < sz << 6; ) {
    negInvM *= (m * negInvM + 2);
    chmin(e <<= 1, sz << 6);
    if ((int)negInvM.data.size() > (e + 63) >> 6) negInvM.data.resize((e + 63) >> 6);
  }
  assert((m * negInvM + 1) % (bigint(1) << (sz << 6)) == 0);
  two2 = (bigint(1) << (sz << 7)) % m;
}
// 2^(-6sz) a mod m
bigint reduce(const bigint &a) {
  bigint c = a * negInvM;
  if ((int)c.data.size() > sz) c.data.resize(sz);
  c = (a + c * m) >> (sz << 6);
  return (c >= m) ? (c - m) : c;
}
bigint mod(const bigint &a) {
  return reduce(a * two2);
}
bigint mul(const bigint &a, const bigint &b) {
  return reduce(reduce(a * b) * two2);
}
bigint power(const bigint &a, const bigint &e) {
  bigint b = 1;
  for (int i = (int)e.digit(); --i >= 0; ) {
    b = mul(b, b);
    if (e.data[i >> 6] >> (i & 63) & 1) b = mul(b, a);
  }
  return b;
}
}  // montgomery

constexpr int LIM_SMALL = 16;
int lpf[1 << LIM_SMALL];


#include <random>
mt19937_64 rng(58);

// phi(n) | 2^E L && n: square-free
int E;
bigint L;
vector<bigint> ps;
void solve(const bigint &n) {
  assert(!isOne(n));
  montgomery::init(n);
  constexpr int NUM_ITERS = 10;
  for (int iter = 0; iter < NUM_ITERS; ++iter) {
    bigint a;
    a.data.resize(n.data.size());
    for (int i = 0; i < (int)n.data.size(); ++i) {
      a.data[i] = rng();
    }
    a = montgomery::mod(a);
    {
      const bigint g = gcd(a, n);
      if (g == n) {
        continue;
      }
      if (!isOne(g)) {
        solve(g);
        solve(n / g);
        return;
      }
    }
    a = montgomery::power(a, L);
    if (!isOne(a)) {
      for (; ; ) {
        bigint b = montgomery::mul(a, a);
        if (isOne(b)) {
          const bigint g = gcd(a - 1, n);
          if (!isOne(g) && g != n) {
            solve(g);
            solve(n / g);
            return;
          }
          break;
        }
        a = b;
      }
    }
  }
  ps.push_back(n);
}

int main() {
  for (int p = 2; p < 1 << LIM_SMALL; ++p) lpf[p] = p;
  for (int p = 2; p < 1 << LIM_SMALL; ++p) if (lpf[p] == p) {
    for (int n = 2 * p; n < 1 << LIM_SMALL; n += p) chmin(lpf[n], p);
  }
  
  bigint N, M;
  for (; cin >> N >> M; ) {
    vector<bigint> ans;
    bigint n = N, m = M;
    {
      const int s = bsf(n);
      if (s) {
        for (int i = 0; i < s; ++i) {
          ans.push_back(2);
        }
        n >>= s;
        m >>= (s - 1);
      }
    }
    for (int p = 3; p < 1 << LIM_SMALL; ++p) if (lpf[p] == p) {
      int e = 0;
      for (; mod(n, p) == 0; ) {
        ans.push_back(p);
        n /= p;
        m /= (e++ ? p : (p - 1));
      }
    }
    for (; !isOne(n); ) {
      E = bsf(m);
      L = m >> E;
      ps.clear();
      solve(n / gcd(n, m));
      for (const bigint &p : ps) {
        ans.push_back(p);
        n /= p;
        m /= (p - 1);
        for (; !(n % p); ) {
          ans.push_back(p);
          n /= p;
          m /= p;
        }
      }
    }
    assert(isOne(n));
    assert(isOne(m));
    
    sort(ans.begin(), ans.end());
    cout << ans.size() << '\n';
    for (const bigint &p : ans) {
      cout << p << '\n';
    }
    cout << flush;
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 5
Accepted

Test #1:

score: 5
Accepted
time: 1ms
memory: 3800kb

input:

1 1

output:

0

result:

ok "0"

Test #2:

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

input:

1000001010000010011000000000001 1000001010000000000000000000000

output:

2
100100000000001
1110100000000001

result:

ok 3 tokens

Test #3:

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

input:

100011100111101010100110101011 100011100111011001010101000000

output:

2
10011001001011
1110111000100001

result:

ok 3 tokens

Test #4:

score: 0
Accepted
time: 1ms
memory: 3792kb

input:

10001001101010010000101100001111 10001001101001111001001011011000

output:

2
1011000000011011
1100100000011101

result:

ok 3 tokens

Test #5:

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

input:

11010101110001001000101110100011 10001110011111110101111001100000

output:

4
11
11
100100101110011
101001011001001

result:

ok 5 tokens

Test #6:

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

input:

11110110100011100110011001 11110100100110011000000000

output:

3
100010101
101100001
1010010101

result:

ok 4 tokens

Test #7:

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

input:

11111101101000100101001011110000 1111110001100110011100011000000

output:

7
10
10
10
10
110111011
1010010011
1110001111

result:

ok 8 tokens

Test #8:

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

input:

10000000000000000000000000000000 1000000000000000000000000000000

output:

31
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

result:

ok 32 tokens

Test #9:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

10100000001100011011100000000000 100010110011100000000000000000

output:

17
10
10
10
10
10
10
10
10
10
10
10
11
111
1011
1101
10011
10111

result:

ok 18 tokens

Test #10:

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

input:

10100010000000000000000000000001 10100010000000000000000000000000

output:

1
10100010000000000000000000000001

result:

ok 2 tokens

Test #11:

score: 0
Accepted
time: 1ms
memory: 3756kb

input:

11011011011011001101111101010000 101101100110000011101000000000

output:

9
10
10
10
10
11
101
111
1011
110000101000100111

result:

ok 10 tokens

Test #12:

score: 0
Accepted
time: 1ms
memory: 3820kb

input:

110000101111111000100000001 110000101111100100110000010

output:

2
10011101111111
10011101111111

result:

ok 3 tokens

Test #13:

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

input:

110011010101010011110001 100000011111011111100000

output:

8
101
101
101
111
111
1101
1101
1101

result:

ok 9 tokens

Test #14:

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

input:

100001110101100001111101110111 100000100101110000010111000000

output:

4
11101
11101
1011111001
1101110111

result:

ok 5 tokens

Test #15:

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

input:

110111000001001110000000001111 110100101000000111101101001100

output:

3
10111
10111
110101010000000011111

result:

ok 4 tokens

Subtask #2:

score: 15
Accepted

Dependency #1:

100%
Accepted

Test #16:

score: 15
Accepted
time: 2ms
memory: 3800kb

input:

10100111000100000000000000000011100100000000000000000000000001 10100111000100000000000000000000000000000000000000000000000000

output:

2
1000010000000000000000000000001
10100010000000000000000000000001

result:

ok 3 tokens

Test #17:

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

input:

1000010000111101001111000011011101001000011011101010000010110001 1000010000111101001111000011010111010111011001001101011101100100

output:

2
10101010100101101001100101011111
11000110011100110010111111101111

result:

ok 3 tokens

Test #18:

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

input:

1001011100010111001100011001111111010011001111110111011010111001 1001011100010111001100011001111001000110010111101110000111110100

output:

2
10101100000000010111100000001111
11100000110111110001110010110111

result:

ok 3 tokens

Test #19:

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

input:

1100100001100010110111100100101001111000010010100011110010110000 110010000110001011011110010000000010001001010011111110000000000

output:

6
10
10
10
10
10110011011100000011110001011
10001110111100010101110011000001

result:

ok 7 tokens

Test #20:

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

input:

1010101001010100010010001101000111000100010110010111111001100000 101010100101010000011000100110001101001011001011011000000000000

output:

8
10
10
10
10
10
10001010110010000101
10010001100100110111
100010100010000100001

result:

ok 9 tokens

Test #21:

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

input:

1011000100010101011000101010110000001001011100000000000001 1011000100010101000000000000000000000000000000000000000000

output:

3
100100000000000001
100010100000000000001
100100100000000000001

result:

ok 4 tokens

Test #22:

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

input:

101110011111000001101010111000000000111001000000000000001 101110011111000000000000000000000000000000000000000000000

output:

3
101000000000000001
10001000000000000001
100011000000000000001

result:

ok 4 tokens

Test #23:

score: 0
Accepted
time: 1ms
memory: 3728kb

input:

1000000000000000000000000000000000000000000000000000000000000000 100000000000000000000000000000000000000000000000000000000000000

output:

63
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10

result:

ok 64 tokens

Test #24:

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

input:

11110011110101111001001011010001111000011100110110000000001 11110011110101111001001011001100010111000111010001000000010

output:

2
101100001010101100100111111111
101100001010101100100111111111

result:

ok 3 tokens

Test #25:

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

input:

100001011001100001110000001100100000000110000000110001 11010001011110111111001000110100010000000000000000000

output:

10
111
111
111
10011
10011
10011
11101
11101
11101
101000000000000001

result:

ok 11 tokens

Test #26:

score: 0
Accepted
time: 1ms
memory: 3780kb

input:

110101111011111001001010000111000010010000101101100011010111 110101111011010011000110101000011001001010110111110000000000

output:

4
10010001111111
1001011010011101
1010010111011101
1111100000100001

result:

ok 5 tokens

Test #27:

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

input:

1111010001111011110110111110111110010010011100001000000000000000 111000110100111001111001110001101101010110101000000000000000000

output:

24
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
11111
11111
11111
101011
101011
101011
111101
111101
111101

result:

ok 25 tokens

Test #28:

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

input:

1001000010000000000000000000001000100000000000000000000000000010 100100001000000000000000000000010001000000000000000000000000000

output:

3
10
10001000000000000000000000000001
10001000000000000000000000000001

result:

ok 4 tokens

Test #29:

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

input:

11110011111110001110100010001010000001100000011000111 10100011001000011100000101000000110000000000000000000

output:

10
111
1101
10011
101001
101111
110101
1000111
1001001
1010011
1110001

result:

ok 11 tokens

Test #30:

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

input:

100100000100001011001110111001100101010011010110010101 100010110110100001110110011010000010001110111110000000

output:

8
111101
111101
1011001
1011001
1011001
10011101
10011101
10011101

result:

ok 9 tokens

Subtask #3:

score: 10
Accepted

Test #31:

score: 10
Accepted
time: 4ms
memory: 3832kb

input:

100001100011000011110101000011010100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010011101101001101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 10000...

output:

2
1111000011101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
10001110100110000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #32:

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

input:

100011010001011001101110110101100000111100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001100010000101101000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001...

output:

2
100100111000011101110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
111101001101001010010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 3 tokens

Test #33:

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

input:

11111111110101100011000111001011110101010110011000101010110011100101111010010100000001011010101111111001000000000001001110101110000001011111111011000010101011101100111110100000110001110010101101101111110111101001101010010011011100110001101100111111001000100011100000000000110101111101000010011011001 ...

output:

2
100101010001111000101000010010001010011111000110010110101010111101011111001101001100001111011001100001101011001110100011101110100010011111011111100101
110110111001101100000101011101000101110111110101110100011000000001100100100010010001010010111000100110100110110000011011010010011011100110000111100...

result:

ok 3 tokens

Test #34:

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

input:

1011010101010100110010100100011010010000000101001101011001110111011110000101110000000000000000000000000000000000000000000000000000000000000000000001001000011000011001101101110010110011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 1...

output:

2
1100000000111111011110010110100110011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
111100010111011010001111011100001101000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #35:

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

input:

1010100011010100011011010000010001100001101110110010001111110100100001111110001010101100000100001101000110010101011110000111100100001111011101001001110000011011000011010001110001001110001111000001000000101000010100111010101010010111101101010101110011010010101111110000000000000000000000000000001 1010...

output:

2
101101100011000010000111110100011100101101011001110110011100100001101000001101000100100000111000000111010111011100011000000000000000000000000000001
1110110100111010010011110001010110100111010001101011110111100101101000010011010100101000100011101101011111011010011011000000000000000000000000000001

result:

ok 3 tokens

Test #36:

score: 0
Accepted
time: 8ms
memory: 3756kb

input:

100011010100100001010111011101110001010010111011001001111100001001001100011110111110001101101111101111000101110000000110110000000011101001101001110101101000000111100010111110110100111011101001100101010110101010100110000110001000010111110111000000011101101010101001111011000010010100100010111010111011...

output:

2
101111000010110010010101110010001011010100100001001000101011001000111000011111011011011010110010001001000100100001100111001100011111100001101111111101
110000000011010011101100110100000010110111111110010101001101111110010101101101001011000100101001111110111110000000011000100110111011001100011100010...

result:

ok 3 tokens

Test #37:

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

input:

11010100011100001010111010011110000000001010100110010101100110100100110100100011101010010001111101111101010101001001010101010100000101000011001000100010001111110100111100011111100101010010001111110100011100101011001001000111011111100011010011000101111010011001011011100110110110100010010011011 110101...

output:

2
10101011000100101001010101101001111110011010011000110000111000101100111010011101100011001100101100110100111000110001100001110100001100110110011011
1001111011110011101110100011110001000001011101010111111000001001001110010100011011100101101111001101110110000011001100100011101100100101010100000001

result:

ok 3 tokens

Test #38:

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

input:

100000110001111100011101111011111000010100000110100001011111011011100101101000011111101000000111000011010001010000111111011001111110010000000001010010001100000111010010100001110010111001011101100011010010001100101000001111101000000111011000000101010101011110100101101100100010101000001101000110010101...

output:

2
1010001001110101010100101011011001110101101101011110011000111101001110100011011000110110100011010101
11001110100111101011001000000011010000110111010010001011101010110101100001000110001101111110110111110011110000010001000011100110000011000010100110010100111101000001100100000000011010000010010111000...

result:

ok 3 tokens

Test #39:

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

input:

110111000011000101001010101000100110010010101000000111010111000010001011001100010010011111010011011110100001101010100001100001100111000011110100010011000100110101000011001111100110000110110101101110010110111110111001111111011101001111011001001010111011010001010010110111000010100011011011010100111 11...

output:

2
11011001001101000101010101110000100010011011100001
10000001110000101100101101101111000100110001100110001100101101100100000111001000100001000101000111101100011000011111101101110110000110111110101000011000010000111010000000011011111111110000111011010000000111111111110011000110111100111111011010000111

result:

ok 3 tokens

Test #40:

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

input:

100011011101111100000001100100010110000001100000111000100100111000010000100000100010001111000111100100101110000100110010101011111000111111010111100100100000000000000000000000000000000000000001011000111110001001100110100101101111000001001110100010101100100110100001001010111001110100101001011 10001101...

output:

2
1011000111110001001100110100101101111000001001110100010101100100110100001001010111001110100101001011
11001100000110110000101111011111101010001101011101100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #41:

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

input:

110100101101111011001100100011111101100111010000110110100000100011111001010011100111000010001100001000111100010111010000000010001001111000100101100001101111011100000110111100111011100000111110011010010100000010000101100000010001000001010101110110011101110101011101100110011111110001010110001010011 11...

output:

2
10100000010000101100000010001000001010101110110011101110101011101100110011111110001010110001010011
10101000011010111111100100111110100100000110001110100011101111110001000010000000100111110111010111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #42:

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

input:

11011001010001000010101111010011111101111100011110010011000010101110100010101001001110110001100011010100111111100000101000100010010001010010110110000011001010111001001101001001000110000011100000001100100001000100101101010000110100111111010111011001100000000000000000000000000000000000000000000000001 ...

output:

2
11100100111000101100010100000110001110000000101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
111100110000000100000110100111111110101011111100010100001000100101101010000110100111111010111011001100000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #43:

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

input:

111111101010011000000001011010101011111111100011100011110100000111010001011100110001010111011111110001100101101011101000110001010000111110000001111111001100011000011001001000110010111100111001011011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010...

output:

2
10
1111111010100110000000010110101010111111111000111000111101000001110100010111001100010101110111111100011001011010111010001100010100001111100000011111110011000110000110010010001100101111001110010110111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

result:

ok 3 tokens

Test #44:

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

input:

110 10

output:

2
10
11

result:

ok 3 tokens

Test #45:

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

input:

11010001110110110000001011100101011000101111010101010011100111100000001110010110001011000011101001011011011000101100110000000000100000100001001101000101001100100110000101010010011100010011000000000001100000001011100010001011000011111001111010000000100111001110100011110001101010000011111010101001110 ...

output:

2
10
1101000111011011000000101110010101100010111101010101001110011110000000111001011000101100001110100101101101100010110011000000000010000010000100110100010100110010011000010101001001110001001100000000000110000000101110001000101100001111100111101000000010011100111010001111000110101000001111101010100...

result:

ok 3 tokens

Subtask #4:

score: 15
Accepted

Test #46:

score: 15
Accepted
time: 8ms
memory: 3812kb

input:

11011110000000000010100100101011111000100001100010011001110111010100101110110011111101111100001110110100010000000001111000110000100110111011000111000111001010000001010111010001111111000111100110011010111001011011010001100010101001001111111101000110011110011101011100000001101110111011000101010101101 ...

output:

2
100001101110001100011100001000111100010010000001111101101111011101000011000110100000110100010101100110100011010011100101000010011000011110110100010011
110100101010101001100011111111100111101100100010110001110000100110110110011100010001110100110010101000001100010101011000111101010100000110000100111...

result:

ok 3 tokens

Test #47:

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

input:

1101010101001110110000101001001111110100001110110101110111001100101000111110001010100000101100111110101010111111001001010101111110111010011111111010000011100001101110001001110110110011000001000100100111000011010001111110101011111101100010111110101011010011111001001010011100101000111011110110101 1101...

output:

2
10000001001100111111011111100001101000011111110110101101010101000001101011100101010101000111100101010011011110100101001011110101111110000110111111
110100110101001001010001111001100010101000000100001000100101011011110010111010010111011010011001111101000000100010100101000011011000100101101110001011

result:

ok 3 tokens

Test #48:

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

input:

11000000010000011101001101110011011010001101101011010011110001100001111011010011111101010000100001101101101001011111110100101010001001010001111001010110111110000001001100111110010110010000010011101100010111110000011000110010001001000110000110110000111011001001111011101001100100010110111000101111 110...

output:

3
11000111011110011001100110110000101110010011101010101011001001001101111000000100010011100010000011
110110001011100011100111100100111000111000110110110100100100100010101010011110100100010011000100111
1001000110111010001000111101101101011011100001011111001111110011011010111110110100111011000100010011

result:

ok 4 tokens

Test #49:

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

input:

10000000100111110100011011010100111111101000101010010000000110101010001111000111111001011100011110101110111001010110111010111001011010000000011000110010011001111001100011000101110101000001011010110100010101111010111111111010001100101111110100101111010101011111000110000110110001000011100100100101 100...

output:

4
10001011111011111010100011011111001111011101111101011011101101011100100111
10100101111101110000100110001011001001000011111100101110100100101010010111
100011110110111110101000110000000011010011010001011001001011010100100111011
101000011111001000110110011010110000111010000001010110110101110111100011...

result:

ok 5 tokens

Test #50:

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

input:

110110100011111110001000010100110110101100101001101001110111100101000011000010101110110111100000011011111001011110100001100001111110110000111001011010111011001010100010010101010011000100110001111101011111000011010000010101110001100100111000111101011011010011110100101100110001000011011101001 11011010...

output:

6
10011101001110010011100010110001101011101011011
110011001100001001101001110000110010001111111111
1001011010001000001100000000101110110000100010111
1111110101010010110011010101000000000111110110111
11011000001110011100011000101001101111010110010111
11100010000000010011100000010111010011110100000011

result:

ok 7 tokens

Test #51:

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

input:

11000010100100010010101111101101001001001011001111011101011100011110111000011110101110010000101111110101001011010100011110110110010110000001011111011110000010111000010111110000100001100100110000110100010100011111001101010101001100100001010010110001010000100101101100110110101010101110011010101 110000...

output:

4
111001111111110101100111001110010100111111010011
1100111001101000001110101101000000100001010011011
11110101100100101011111101001110110110011011010011
100010101100110001100100110010111000100100111001101100110001011101111001011110101111110011110011111001000000101011000110000101111101010010101110111

result:

ok 5 tokens

Test #52:

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

input:

1101011111101000011101101100000110101011101100111011010100011001111011100000000000010011101001100000001000100110010110011010000011011000100110101111001111111101000000111010111001110110010010100001000001011001111011111101111110001101101001001101011110000001010100110110110000110000001100000111100111 1...

output:

1
1101011111101000011101101100000110101011101100111011010100011001111011100000000000010011101001100000001000100110010110011010000011011000100110101111001111111101000000111010111001110110010010100001000001011001111011111101111110001101101001001101011110000001010100110110110000110000001100000111100111

result:

ok 2 tokens

Test #53:

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

input:

11000110101111001100011101111000010010000101010100100000001011000001111101100000101001001001011011110010101001100010111010011111110010000001011010000111010010011111101010010001101001000011010101001110000101111011100001000000110010000000100111010001100000110010011111011100100001110000010011011011 110...

output:

1
11000110101111001100011101111000010010000101010100100000001011000001111101100000101001001001011011110010101001100010111010011111110010000001011010000111010010011111101010010001101001000011010101001110000101111011100001000000110010000000100111010001100000110010011111011100100001110000010011011011

result:

ok 2 tokens

Test #54:

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

input:

110011101001010111100100011110000111011000001111000011111011000001110000101001001011100111100001000001001001011010111101110110000001101010011101111000011100111010110100100010100111001010001001000001011111101001010010110111111100001110111111001000110001001110111011000101101 11001110000111111111011101...

output:

20
11101110011
111100010111
1000010010011
1001010110011
1111101111011
10001101101011
10110101000011
10110111010011
11001001111011
11001101110011
11100100101111
11111111101011
100001110010011
101001001001011
101101100101011
111001000010111
111001101011011
111001111110011
111010100000111
111100100000111

result:

ok 21 tokens

Test #55:

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

input:

10000001010010101010101101001100101110110101110111100010111101000010100111000010101100011101111110011110100001010001000001000100010001001101011000101010100000010110111110110111111010111100010110000011011101010111101011011101010101000011111010101010111000100101111101001101101000010100100000011 100000...

output:

9
101011011001000010111100010011
11010001111001010011000111111111
11111110010010000110101010011011
100111001110010110100111101011011
101010110000010010011110111101011
111001001010010011000110101111011
1011011100100011111111010001100111
1110010110001110110111110100010011
11111001100011000100110110100...

result:

ok 10 tokens

Test #56:

score: 0
Accepted
time: 1ms
memory: 3788kb

input:

10110101001000000110010101010110110100001010001110011100110110101010010001100001010100110101011110101001011011101001011111001110011110000100010100110010000000110100101000010101110010100100000011001101100110000100001111100000000101100100100011111001011010000001011101000111101111101100100101 100011000...

output:

30
111
11111
101011
1000111
10100111
10111111
101100111
101111111
1000111011
1001001011
1100010011
1100101011
1101110111
1110010111
1110110011
10111110011
11010111011
11111011011
100100100011
100101001111
100110001111
100111100011
100111110111
101100000011
101100111111
110100010011
111001010111
1111...

result:

ok 31 tokens

Test #57:

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

input:

10010110110000010001101100011010001110110111000111110011110101010111101011001000100100000110110101011100110111011010011100011101000101000101000100111100000100010001001011101000000011100010010100001100011100010110011011100011011000100000101110110001010010000000101001101110101101100111000001 100101101...

output:

6
111111010011101000111100010111000011
11011000100001111100110001010011100011
101101010101000110010110010100101001111
1010111111101001011101011101000011110011
1101001010011100001000110000010001100111
11100001000000010110010000010011000011010011010011110010100000111111110101100100010000101000101011

result:

ok 7 tokens

Test #58:

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

input:

10100001001100010100001100011110111100100000001111000001000110101001001000001010110110100111010101111110101100010010111111111100101110110000110001001111010000101011101000101000110000101111100100011001001001100001011000001001001001011110111111010011001111111111010110001111011001010010010111000101 100...

output:

6
1101011
101011011
101101111
110111011
111001111
1111110110100111001110110011111111011000101000110100001001111110101111110101000001110100000001000101111011100101111101110010101000001101111110001001000001110010001000100010100010100111100101100101110111010100101101000011010111010111010000101101110000...

result:

ok 7 tokens

Test #59:

score: 0
Accepted
time: 31ms
memory: 3788kb

input:

10010001010100101001011011110011010000100000010000010000110001011000101010010011010101010010110001001101011100101101011011110001110001010101010000110100000000110101100010001000101111101000001000110000111000110010101010101000101101000110100110000000010000111001001001110000010001101011011100001 100100...

output:

10
1100001011110001000010100111
11000000100101111001111110111
11001100010110011110010011011
100000100110000100110010110111
101000111010110111011000100011
101111100100001011010110001011
110100010111110001100100100111
110111000001000010000111111111
111010110110000111010000101011
1111110111000110101110...

result:

ok 11 tokens

Test #60:

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

input:

1 1

output:

0

result:

ok "0"

Subtask #5:

score: 15
Accepted

Dependency #4:

100%
Accepted

Test #61:

score: 15
Accepted
time: 5ms
memory: 3760kb

input:

110111010010011000110101111011100011110100101011100111000000000000000000000000000000000000000000111011100101010110100010010100101001110000000000000000000000000000000000000000000000000000000000001111111110000100000100000000000000000000000000000000000000000000000000000000000000000000000000000001 11011...

output:

3
1011010111011101100000000000000000000000000000000000000000000000000000000000000000000000000000001
11100010000011010100000000000000000000000000000000000000000000000000000000000000000000000000000001
1011000001000101000100000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 4 tokens

Test #62:

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

input:

100011110110000001011010110011110111110101101111101010111111111111001010100001010101001011000111111011000010011101100100110110001011001101010011000011100011110000010110111100011001000101110001110101010101000000110010001111100100010101110001000100111000111001100011000101110010111000110000000000001000...

output:

6
10
10
10
101011100000000101010111001011010100110011100000000001110110001000100101100011001010110000000000001
111000111111101111011011111010111000100101101111000100010100111110001100111001011110110000000000001
11101100110111000001011001101001100111011110000001001111000011101111011111011000111101000...

result:

ok 7 tokens

Test #63:

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

input:

1000011110100000111001011111111100110100000001100011011010001001110001000001100111100101101000010101110111110001101010101011010011110111100000101000001100011001110101000101101000000110011111101000101100001100001000000101100000100010110110110111111110010100111001110001111010000101110011010011 1000011...

output:

5
1100100000111011111000000110010001001101110001111010001
10001110011010101010100001000001011101110001000100011100001
101000011001101111011100100011001011111011001100011001011101
101010100101111010010110011010110100110011000010000011010111
101110010111101010111001011001000111111101011110010001111001

result:

ok 6 tokens

Test #64:

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

input:

101000000011011110100011001011001010010001011010100011011011110111100000000001011100110000001111111001101000111100101110101100101100101100000110001100000000101011010001111001001010101110111001100011101010000111011100000001111101100100111110010011110100011110010111101101010111111100000000000000000000...

output:

30
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10001100011000001000110011
10001111110100100111010001
110010001001011110000000001
1010110011001000100100000001
1111000101001111110011101101
11011110011000111110001100001
100101110100110100011100001001
101010010110001001111110000001
11001...

result:

ok 31 tokens

Test #65:

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

input:

10001100011001101111101011111110110101011000011100010011110010111000001011111011110111011111000101001100001001001111001001000100001011110001101110110111110000000101101111101111010110100110110101000100011000110100010010011110000101111011011110001100101100111000011111000000111111000111000101010011 100...

output:

6
1000001011001001011000100000011110001
110101011000011110100001101000001100001
1101110110000101010101010011100011000001
1110001100011101100111000011010101101101
1110111001001110101010010010100001001001
1110011010000111000101010111111011100000110000101000001001001010101110110100001101110100011000101...

result:

ok 7 tokens

Test #66:

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

input:

11110101001000110101100000111000110110011010000000011100101111111110101000111011000011101101111001110111100011100101000111001011001100010000100111110010101110110110010110100001100010101111111011001100111001111100001010011000000000000000011010010111110000111000010111010110110101011000010011001111 111...

output:

7
10110001101101100011000010110100001
11000101100100111111100011011111001
11010000001000111101101011110000001
11010111001010101010000110011000001
11100100101010110010000010110010001
11111110101011001010000010010010101
1011110001011110111111000011110001111011101111010100110110111110010000011010010001...

result:

ok 8 tokens

Test #67:

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

input:

100001000111100011001010110010111001011110111000010111101010111011001111001101000001000111010100010111100000011001001011001011001001110001000011010001110100010100110011110110111100111101110100001100000101010011001111100101001100011110101011111110111100010111100100000001101000111110111111011 10000100...

output:

8
1010101011001010110110101001
1110101110001000010100000001
10010111110000000111010000001
100010101001111111011100100001
100011110000111101101000010101
100100011111101101000101000001
100111011101011100101110110001
11010101110111110110000111111100011100000110001010010100010011000011011100100010011100...

result:

ok 9 tokens

Test #68:

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

input:

101001001101010000111000000101101000100101100000101110001111000110101001111110001000011001101111011101111100000110110011011111110110011110110111110111011000101011010011001011001100100101111110001000101010110011011101110011001111001101000111000101101110100010101100011101000011010111000101110000000000...

output:

16
10
10
10
10
10
10
10
10
10
10
100000010001000010001011101001100001
11010010110011110010010000101111101001
11010010110101101111011100110011100011
101101001000000010110001100111010000101
1101000111100011001100111011110110010001
11010000011110011001100111001000011100110111000011101101100111000011011...

result:

ok 17 tokens

Test #69:

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

input:

11010001011011010110001011011111010100100011001110000010011010011110000100110001000010100001010000110010101000110100110011010100001101111110010000001100111110011101001101111110101011100000010110111110010110100111110110001110000100001110001111101011011101011100100110110001110100001000111 110100010110...

output:

7
100010011010100010001101010001
111001001111001010000110000101001
1000111111001010001010111111000001
10010000110000111101111110101011101
10011010011000001011111000000101011
10110000100110001101111000010100001
11001101111111100110011101010000011010010101010000000111111110001010110111111010000000001

result:

ok 8 tokens

Test #70:

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

input:

100001101111000110100011011110000001011100000110000101011001010101101110110010100101010001101000110110111100101010101000100000011000011110111011101010010111101010100111011000011010000011010001000110001001000001101010010010010110111101101000011101000100001100000101000011100101010011000000000000000000...

output:

26
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
100011100110010111011101
10101000100101010111011001
101100101000000100000100001
11101010011000100001010010001
100110110100110100111001000001
101001000111101010000011110111
101100001010010010101010000001
1000011000011010001111100010111111101000...

result:

ok 27 tokens

Test #71:

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

input:

1000010100000110111000000101100111001011110100010000111100111101100011100110001011100010001010001000000000111001011110000100010000100010101000110011100010011010011100011111001110000000011100011110010100100101010001101011001100100001101110011111011101101101101111110111001010001000000100111001 1000010...

output:

5
1101011111100100101110111000110110110110111000001101001
1001010011001110000111110100010011101100101011101010000001
101011100111010110011110000100001000000111010010010011110001
111000010110010101000100111011100001011101101110100101100001
111000100010001100010111101011001001100011000001110110000001

result:

ok 6 tokens

Test #72:

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

input:

111111010011000011101000100111111011110011001101101001101000101110101100001000000001110011110011001001000010010100100001010111001101010010101001010111010110110100001010100100110010110001110001111010110010010111110110011011001000100001111110001111101000110100000111011100010010011101011101101100100000...

output:

10
10
10
10
10
10
1000110010011011011100000110111111100001
1000111011000100001101101111101010010001
1101001101011001001000010111101011101001
1101101000010010110101111011001111001000000011001001101101010010011000011111101110000001
1001001011101011101100011000001111100001011110000011010011101110011010...

result:

ok 11 tokens

Test #73:

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

input:

111110010101110010011000010011010100001101101101101100100010001100101110101000011001100001100001010111001101101101011110110111101001111011000110101001010111101111111010111001010000011100111111101001110110010000000111100001110011000110101100000100011101001011001100110000000000000001 11111001010111001...

output:

10
101111101000000000000001
1000110011101000000000000001
1101111010111000000000000001
10001010010001000000000000001
11101001101011000000000000001
100010000000001000000000000001
100011010101001000000000000001
101001011000111000000000000001
101010110010001000000000000001
101011101110111000000000000001

result:

ok 11 tokens

Test #74:

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

input:

101000111000101001010111001111010011000000100100110100010100011110000111110100111011111001100000010111010010001011000001001000010101010011101011111110110010011011000111011100010110111101010001110110111011000001000000101100001111110000001011011000001111001100010000000100110100000011000000000000000100...

output:

6
10
10
11100100110010110101111100110111011101000101011111111110100100000000000001
11100101001110111101100101100111101001100000111111001001110100000000000001
110111101001000001011011001010011101001000111010110001010110100000000000001
111010110000110110011110100110100011101100111110111101101100100000...

result:

ok 7 tokens

Test #75:

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

input:

101010011101011110110011111100011000011010011010001111011100010010110101100100111111111010101100010101110010100010000110010011010111010010000110001000001101010110111110110001110010101010100001001001110110000110111101011101111100010110001101001111000001001100010110110000101111001000001011000000010000...

output:

7
10
10
10
10
11111111110101101011101000001000011011011001111101010100110000101100011111001100000111010100000001
110010101001010101101001010111000101101010001111101100100011110010100110001101011110000101100000001
110101101100001011011101001011001111100110010001111111000111000010110111010100010111000...

result:

ok 8 tokens

Subtask #6:

score: 25
Accepted

Dependency #5:

100%
Accepted

Test #76:

score: 25
Accepted
time: 4ms
memory: 3760kb

input:

110000100100100001101101111110101010111001000011001011001110011001011111000010001101111001101001111010110010111010101001101010101110111011000010010010011010000101000000111100001110011001001000001101100110000000011010001000110000010011010110110010101111010111110111000110100101011111000010001001101001...

output:

2
110111110000010001000011101011011010000101000010011101101001110110010011010010110001010001100110111011101111100011110010100001101100111010001001101101
110111110000010001000011101011011010000101000010011101101001110110010011010010110001010001100110111011101111100011110010100001101100111010001001101...

result:

ok 3 tokens

Test #77:

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

input:

100000011111011001000000011010100000100000001100101000100111101001001010001111100000000100101111100110100010000111100100100000010011011001011010001111101110110010000101011011111001100100110100011110100011001010011101111101000000001111110000110110010110111110000101100001000100100101011111110001 10000...

output:

3
11001100001110000101111010011011100101100010000101111111001010001110101011001011011001010001010001
11001100001110000101111010011011100101100010000101111111001010001110101011001011011001010001010001
11001100001110000101111010011011100101100010000101111111001010001110101011001011011001010001010001

result:

ok 4 tokens

Test #78:

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

input:

11110101110100111100010111100110111101001011000011010110000011110111011000011011101011000010111001101100101111110101110110010100010011110101101110011010011100001111000001111001101000100000000000110110110001110001100111101010001111010100110010100011100001100011110000001101000000000001 111101011101001...

output:

4
10101001001000010011101101111000111011101110000011001001110000000001
10101001001000010011101101111000111011101110000011001001110000000001
101111011101101100101111111000111111100010011001110011000111100110000000001
101111011101101100101111111000111111100010011001110011000111100110000000001

result:

ok 5 tokens

Test #79:

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

input:

1111011100101000100111100010110011001111001101100001111100100010001110001111100111000010010111000100000000000000000000000000000000000000000000000000111110111000101001011101100001011000100000110011100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 1...

output:

2
11111011100010100101110110000101100010000011001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001
11111011100010100101110110000101100010000011001110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001

result:

ok 3 tokens

Test #80:

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

input:

101001110111111100011110011001010100010011100011100100101010001011011001100001011100000011101111010100111101011101011100011100000011011011111011110100110000000110111101010101110101111110101101000010101010111011011111110010000001010101110101000001001011011101111011111000010001101001100010100111011000...

output:

190
10
10
10
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11...

result:

ok 191 tokens

Test #81:

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

input:

101100100010000010111010011010010010010101011100101011000110101100111110101010000000001011101111011000101111111001001110000111111001010001101101100110011110100000110010011000110000111110100000100000001100111111100011001110110011111100000011100101011111001000011000100000000000000000000000000000000000...

output:

55
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
1000101100011
101000001010011
101000001010011
101000001010011
1010...

result:

ok 56 tokens

Test #82:

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

input:

110000110100000010001100011001100001011011100010101001010101001010001011101001000101010101110010101111011111000011011111100011100000011111000110011110000000010111000000111101000111010100001101101110000110011101101110101100000111001110110110000001011111011000000000000000000000000000000000000000000000...

output:

69
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
110101
1110001
11101111
100010101
100100101
100111101
101100001
101111111
110100101
111001001
11111010011
11111010011
11111010011
11111010011
11111010011
11111010...

result:

ok 70 tokens

Test #83:

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

input:

10001100101111011111010100101001100101010011010111111101110001100001100001010110110100100011011110111000001011010000110111000010001101000001100011011000001110111000101110011000001011101101000110110011111011100110101011001011110000000100000101011111001011010111101101110101010010000001011010011111 100...

output:

4
111110111101100001010100101001100000001
111110111101100001010100101001100000001
111110111101100001010100101001100000001
10010011110100101101000010011100010101001000010001100101010100001100111110000010000111100111011101100101010111000101110001000001001100100111010001000101011010011110110111110011111

result:

ok 5 tokens

Test #84:

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

input:

1011000010110110111111100100100011110011001001011011010100111001001000100100000110001010001000111011000101000010110101110100100001010010110010110011001001001011011101001111010100011000111100110010011110111001110100100111011111111001001101000101111000000000100111011000110101111110011010010110111001 1...

output:

4
1001110110100000000100010101100110101001
1001110110100000000100010101100110101001
1001110110100000000100010101100110101001
1011110101000010001011001100100110101010110001001110101110010100000000101111000110111101110001111100001011010101111000101001111001011001110011110110111011111000010111100100000...

result:

ok 5 tokens

Test #85:

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

input:

1000001000010100010010000000110111001001101111010100001101000001001100110111110000101101111000010111101101101000001000010101101001010000110111000000000000111010001001001000111110000000110101101111101110001010101111000001101100100000010110101111010100100011011001000100111101110101001101011000100011 1...

output:

8
10001
10001
1001001111111100101010101011000011000001
1010000101101100101100001101001010110101
1010011000010111111110000101010110100001
1100010111110000000100010010000010010001
1101011100111010110011010111110001011001
101110110110000000100011101101101110111011100001000111011010110001001011110001001...

result:

ok 9 tokens

Test #86:

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

input:

10011100010011111010111101111110000111011010100010000000100011111010101101100101001100000110010100111000110010111000110010011011110011011100101110111110110101011110110000011101010001000110111001010000001111110010100001001000110100110010100010010110010100000010111111001101101001110001010101000001 100...

output:

10
111
111
111
10111011110100101000000110000101001
11000101101011000101001100011000001
11010001011111101110110100001100001
11100111111000101000111101010000001
11101111010010110011110011010100101
11111000011010000010010011010110001
100110010010010110010111001000110110100000111101110010111011101110000...

result:

ok 11 tokens

Test #87:

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

input:

100110011111111101110110001111010110100001101011101001110110110100100101001101000001110011011110010101111100000011111010111111000111010100001100101100010000001101010010100010011100101001000000101101111011110100000100001000011110010010001000011101110110010100101010100111100111110000111110000000000000...

output:

23
10
10
10
10
10
10
10
10
10
10
10
10
10
10111
10111
1111110110101101110000001
111110100000111001000111001
11000010101000011100001110001
100001110000010101000100000001
101011011110111000110011000101
111100111011110000110000100001
111101111110110001111001000001
10011001010000000010011001101111110010...

result:

ok 24 tokens

Test #88:

score: 0
Accepted
time: 8ms
memory: 3756kb

input:

1111110101010000111101101010001010000111000100001010000110101110001111101010010000110100100101110010111001101111010101101010111011100111010100010011000011110001001001111000001100111011110001011100010101100110001000011110001011010101000010100010011001100111100110111011010100010001011101011 1000011100...

output:

8
11
11
11
101
101
101
1010000000101001001110101110001101110001111011101110001001110101110110010110101110111100111010000010001000110000101001010011000110101000111
1111010110110010110010010000101000101001100010000010001011000010110011010011101111111001010101001000011110011011111110101100101011101010011

result:

ok 9 tokens

Test #89:

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

input:

101101110110001100111110010001011110000001111111110101000011110001110100101101010110001010011100000000010111011100011011010100111001001011010000001111101011001001001010110111110000110011010001100100110110100111110100100110011111101101100011010010001100111110011010010011001001000101101101001 10110001...

output:

5
11101
11101
11101
10000100001000001001110010001101111001101111000011110101100000101011100000110010011011100010111111100001011101101101010011100010111101011
11101110101100011110011010111010100110100101110110100000000101110110001010110011110010010100100010011100101010010111111010110111010100111111

result:

ok 6 tokens

Test #90:

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

input:

111101111011010011010101000110011100001010010010111010000011110001110011011010001110100011000110011110010100101101110111111010101101100111010011011101101110111111000000000101111011011010111010101100101110010110001000111101001110110011000111111100010000010011001101011110100111110100111011001110000000...

output:

16
10
10
10
10
10
10
10
1101
1101
1101
100101
100101
100101
101110000101010101101010000100101010000010101111101001001001010001010001000101000001011
110110100011000101010100011000101001100111111101111110001001000111110011011001101100011111
1111001101100101111000010100001011100100000110000011101100100...

result:

ok 17 tokens

Subtask #7:

score: 15
Accepted

Dependency #6:

100%
Accepted

Test #91:

score: 15
Accepted
time: 151ms
memory: 3820kb

input:

101100100001111011111110000011111100010011110001101011110000000101111010001001111001110101000010101110101001011110010111011100000010100001110011010011110111111001001010100101101110101011111010000101011110000010000110100010010111010001011101000110110000010111110110100001100010001110011000001111100110...

output:

2
111001011010101010001001011011100101110110110111101000010110110001000101011111100110011110100110000000101111101011100110111000010100000111011000001011000101000110110011000111010110011001000000001000101011010110110110001111101111011110011001110011100011100111100110001000000011110101110001000110011
...

result:

ok 3 tokens

Test #92:

score: 0
Accepted
time: 106ms
memory: 3784kb

input:

100111110001111101110101110111011110011001000010011001000101110010011101101100000110101111110000011000100010000101001000101011110100100010101010000110100000111010000001011101111010101101111001100001000000111000101110110111110000010000101101011011101000110101100011001110110101111110101100000110100000...

output:

2
1100011100101011010010010000101000001011100101110010001010111000011110100111110001111000101110110000110100011100001101011111000110101111010111010110000000111000011111101010110100111100100000011101111010101011101101110101100111110110110000001011110110010111000000100000100110101100001111001001111001...

result:

ok 3 tokens

Test #93:

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

input:

101100100011010001011001010100001011010111110111010110110000010101000100010011010111110000100010011001110001000011011111111111100000110011111011010001010011100110010011111100010000101110001011010111011110100100000001000010111011110111111110010010010100110000101011111011100100111111011110100111111100...

output:

5
10
10
10
1100010001000100000010100010001001011110110101110100010110001010000111110110101011011011001000001011110101010111111000111110000010001001001001001100110111100011101101110001110000010000111011111010001110100010111111010111010001100000001110001011110111010100101110000010110100000000111111000...

result:

ok 6 tokens

Test #94:

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

input:

100011111000111100011111001001111101000100101110101011100110110100011010111111101010000000110000010000010001011010110111111110001111111111010010011100011000001000001100011011010110011100010011101000001001010101011110111010011110110100111001001011011101110111001110001110110100111100001010000001111001...

output:

961
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11
11...

result:

ok 962 tokens

Test #95:

score: 0
Accepted
time: 242ms
memory: 3844kb

input:

110000011111001111010100000100011011100110000011101010001110110111001010101111100001000000101111011010110101010011011111101111000110011111110101001011111110111001111010000100101011100110011010001011010101010011101001111011000000011111001011010101111100000110111100011010111011111110111110101010100011...

output:

10
1010010011101111100100010100001000110011100100100000101010101010100111001100111101110110110000100110010011100011001011101011111111100010101101
110000100011000011010001111010000111011100000010111100100101000010011001010111010100001010000011011011000000001001010110010101100100001010111111111
110111...

result:

ok 11 tokens

Test #96:

score: 0
Accepted
time: 215ms
memory: 3820kb

input:

110101011010100100101011110100100010000100111101000111111110110010000011011001110001101100100010100010010001111101011110100011110111011000011011010011111110010011011110010111001101000010110100011101110011100101011110110100110010101110110101010000101001011111011001000011111000010100010101101010011101...

output:

9
101
101
101001000000000010111101110000001010011101101010111011110110000100010011101101011100000001111011101000000001000110111101110111010011111101111111001011010000010101001001101011010001111000100101000001
1101001101100000100110001001111100111011110101110111010010110110000100111111010100101110100...

result:

ok 10 tokens

Test #97:

score: 0
Accepted
time: 768ms
memory: 3844kb

input:

100110111100000100111100001011001010000101001110100100100100111100000011010010001000100111010101111100110000101111100101100101110010011000110101010011111110011111110110110111111010100010111011000101010011000001101111001101101111100110001001001001011110110101011101001111100100100000101100101110001010...

output:

50
1100110010011000000000001
11010010110000010000000001
11011110000001110010010111
101000110100001010111010011
101011110110101010110010001
110000100000000000000000001
1000000110011110000001000101
1000011010000110101010000001
1001100001010000011000101011
1101110000000000000000000001
11100001110011010...

result:

ok 51 tokens

Test #98:

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

input:

101011111110000010110101110110111011101010001001100100010001100100000001100001110100010100110101000000010000001001110111101011111001011000100010110111111010110011000011100110000100001010001001010111110110010011001011110001001000001001100100001011011000100011101110000111111010110111011000110101011000...

output:

243
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10...

result:

ok 244 tokens

Test #99:

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

input:

101101011001010010001000100010011101000000010001011001010001101000101100011100001100101101101101000001011001001010100111011011000011100100011010010001010110010101010111000011111000010100000010111100011100111001001000101000010100010100010011101110111010010101111011101101111011001111010101100000010000...

output:

242
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10
10...

result:

ok 243 tokens

Test #100:

score: 0
Accepted
time: 800ms
memory: 3912kb

input:

111100010010100000011001111111011100011101111000011010011010101000010111111110001111101101001000101000111100100111000101011100000100011111110001100011011111110100110001010010101011101111100001011000111000101110100001010110101010000100101100111000000111100000001011010010011101010110011111011000000100...

output:

50
110101010001011100111001111
111011101111100001010110011
111100011000001010101001111
1000110011000110010111101011
1001011110011000010001010001
1011101110010010110111111101
1110110101010110000110001001
10001010011110101110100010011
10100100000101110110100000001
10100100111011011010000011101
1010011...

result:

ok 51 tokens

Test #101:

score: 0
Accepted
time: 187ms
memory: 3844kb

input:

101110001111000001110100111111110011011000101101011101100001100010110000010111001000110101111010011010001011100101000101100110111011110100100011010011101010011001010000101101000011000101011100110001011010000110010101010111001000101100101010100111100101101000010011111110011111100000100110111001001001...

output:

22
11110000000001
11110000000001
110010000000001
110010000000001
1001010000000001
1001010000000001
1001110000000001
1001110000000001
1100010000000001
1100010000000001
1110010000000001
1110010000000001
100101010110111100101100101011101001000100011110010001110100110000010111101001110000001001011110110...

result:

ok 23 tokens

Test #102:

score: 0
Accepted
time: 193ms
memory: 3792kb

input:

101100111000010010111001110000110001101001101110110100101011000010101100101111001011000110110001010001001100010000100011011101100000111100101110101100111101000001011001110000111100000101010010111100011010010001101111101101001111000100000000000111111001011000110001100000111101111110010110010111001001...

output:

2
11000110101010100010100001111110001010100100000010010001110110010011111110011110000100001010001111110111101001100100110001010001001010011000100101000000110110101001101000001000010110101111110110011
1110011101010011111111110011011011110001001100011000111010111001110101101011110101010000100001011010...

result:

ok 3 tokens

Test #103:

score: 0
Accepted
time: 187ms
memory: 3792kb

input:

110100011110100001010111100101111110100011110100001111111001100000111111010111100101000110101010010100011100010011101100011011110100010001100011001010011111000000110110011011010010110110101001000111000111000001111101110011010110000011010111110000000001100100001010101000000100000110101000000000000101...

output:

2
1111000010101100001001011001100000010010100101111001000110100111001111001010101101111110101001100010110101101111110101000111111001001100110001111100010111100001010101000000110001110000100010011101001001010011101100110000011101110110001110000001110100110010010111000000001000000010101111100010001000...

result:

ok 3 tokens

Test #104:

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

input:

100001111101010000000110111000010010010001101000000110100000011100001110001100011100100011111100101010100000100001011010001010000001101001111010000010101100011101100001111111100010001111000010110100101011111010001110111111100111111001101111001111110011001010011110000100110111011000110110000000001100...

output:

2
1111001011010110010001001100001001111100011001010111000011100101110011011010111110011000010111001111101001110011100010101001110110010110100111110001010111001111000001001111001000010111110101110110000111011101101001100011101101110101000100110101100110100111100101110010101110011010011001001011110110...

result:

ok 3 tokens

Test #105:

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

input:

100011110110110111010100100010101110000110010100011001010000110000011011110010101010011111011000100010100110111010111000010101101001010001011101100000110010110111111011011011100101101001010011000010101100101110111101000110010000001111000110011111100000000000111110010110101111010100111000011001101010...

output:

1
1000111101101101110101001000101011100001100101000110010100001100000110111100101010100111110110001000101001101110101110000101011010010100010111011000001100101101111110110110111001011010010100110000101011001011101111010001100100000011110001100111111000000000001111100101101011110101001110000110011010...

result:

ok 2 tokens

Extra Test:

score: 0
Extra Test Passed