QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#182469#4893. Imbalancehos_lyric100 ✓1173ms10608kbC++148.6kb2023-09-18 03:47:372023-09-18 03:47:39

Judging History

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

  • [2023-09-18 03:47:39]
  • 评测
  • 测评结果:100
  • 用时:1173ms
  • 内存:10608kb
  • [2023-09-18 03:47:37]
  • 提交

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")

////////////////////////////////////////////////////////////////////////////////
template <unsigned M_> struct ModInt {
  static constexpr unsigned M = M_;
  unsigned x;
  constexpr ModInt() : x(0U) {}
  constexpr ModInt(unsigned x_) : x(x_ % M) {}
  constexpr ModInt(unsigned long long x_) : x(x_ % M) {}
  constexpr ModInt(int x_) : x(((x_ %= static_cast<int>(M)) < 0) ? (x_ + static_cast<int>(M)) : x_) {}
  constexpr ModInt(long long x_) : x(((x_ %= static_cast<long long>(M)) < 0) ? (x_ + static_cast<long long>(M)) : x_) {}
  ModInt &operator+=(const ModInt &a) { x = ((x += a.x) >= M) ? (x - M) : x; return *this; }
  ModInt &operator-=(const ModInt &a) { x = ((x -= a.x) >= M) ? (x + M) : x; return *this; }
  ModInt &operator*=(const ModInt &a) { x = (static_cast<unsigned long long>(x) * a.x) % M; return *this; }
  ModInt &operator/=(const ModInt &a) { return (*this *= a.inv()); }
  ModInt pow(long long e) const {
    if (e < 0) return inv().pow(-e);
    ModInt a = *this, b = 1U; for (; e; e >>= 1) { if (e & 1) b *= a; a *= a; } return b;
  }
  ModInt inv() const {
    unsigned a = M, b = x; int y = 0, z = 1;
    for (; b; ) { const unsigned q = a / b; const unsigned c = a - q * b; a = b; b = c; const int w = y - static_cast<int>(q) * z; y = z; z = w; }
    assert(a == 1U); return ModInt(y);
  }
  ModInt operator+() const { return *this; }
  ModInt operator-() const { ModInt a; a.x = x ? (M - x) : 0U; return a; }
  ModInt operator+(const ModInt &a) const { return (ModInt(*this) += a); }
  ModInt operator-(const ModInt &a) const { return (ModInt(*this) -= a); }
  ModInt operator*(const ModInt &a) const { return (ModInt(*this) *= a); }
  ModInt operator/(const ModInt &a) const { return (ModInt(*this) /= a); }
  template <class T> friend ModInt operator+(T a, const ModInt &b) { return (ModInt(a) += b); }
  template <class T> friend ModInt operator-(T a, const ModInt &b) { return (ModInt(a) -= b); }
  template <class T> friend ModInt operator*(T a, const ModInt &b) { return (ModInt(a) *= b); }
  template <class T> friend ModInt operator/(T a, const ModInt &b) { return (ModInt(a) /= b); }
  explicit operator bool() const { return x; }
  bool operator==(const ModInt &a) const { return (x == a.x); }
  bool operator!=(const ModInt &a) const { return (x != a.x); }
  friend std::ostream &operator<<(std::ostream &os, const ModInt &a) { return os << a.x; }
};
////////////////////////////////////////////////////////////////////////////////

constexpr unsigned MO = 998244353;
using Mint = ModInt<MO>;


Mint det(vector<vector<Mint>> a) {
  const int n = a.size();
  Mint ret = 1;
  for (int h = 0; h < n; ++h) {
    for (int i = h; i < n; ++i) if (a[i][h]) {
      if (h != i) {
        swap(a[h], a[i]);
        ret = -ret;
      }
      break;
    }
    ret *= a[h][h];
    if (!ret) break;
    const Mint s = a[h][h].inv();
    for (int j = h + 1; j < n; ++j) a[h][j] *= s;
    for (int i = h + 1; i < n; ++i) {
      const Mint t = a[i][h];
      if (t) for (int j = h + 1; j < n; ++j) a[i][j] -= t * a[h][j];
    }
  }
  return ret;
}


int N, K, M;
char S[120];


namespace small_k {
Mint run() {
  vector<char> ban(1 << K, 0);
  for (int p = 0; p < 1 << K; ++p) {
    ban[p] = (2 * __builtin_popcount(p) == K);
  }
  vector<Mint> crt(1 << (K-1), 0), nxt(1 << K, 0);
  crt[0] = 1;
  for (int i = 0; i < N; ++i) {
    fill(nxt.begin(), nxt.end(), 0);
    for (int p = 0; p < 1 << (K-1); ++p) {
      for (int a = 0; a < 2; ++a) if (i >= M || S[i] - '0' == a) {
        nxt[p << 1 | a] += crt[p];
      }
    }
    if (i + 1 >= K) {
      for (int p = 0; p < 1 << K; ++p) if (ban[p]) {
        nxt[p] = 0;
      }
    }
    for (int p = 0; p < 1 << (K-1); ++p) {
      crt[p] = nxt[p] + nxt[p | 1 << (K-1)];
    }
  }
  Mint ans = 0;
  for (int p = 0; p < 1 << (K-1); ++p) {
    ans += crt[p];
  }
  return ans;
}
}  // small_k


/*
  assume 1: always fewer
  s[i]: # of 1's in [0, i)
  s[i + 1] - s[i] \in [0, 1]
  s[i + K] - s[i] \in [0, K/2)
  path j: from (0, s[j K] - j (K/2)) to (K, s[(j+1) K] - j (K/2))
*/
namespace large_k {
int J, Y0, Y1;
vector<int> SX, SY, TX, TY;
bool ban[120][120];

template <class T> void doDP(int sx, int sy, T ret) {
  sy -= Y0;
  if (ban[sx][sy]) return;
  ret[sx][sy] = 1;
  for (int x = sx; x < K; ++x) for (int y = 0; y <= Y1 - Y0; ++y) if (ret[x][y]) {
    if (!ban[x + 1][y    ]) ret[x + 1][y    ] += ret[x][y];
    if (!ban[x + 1][y + 1]) ret[x + 1][y + 1] += ret[x][y];
  }
}

Mint dp0[120][120];
Mint dp[120][120][120];

Mint solve() {
  {
    const int dx = TX[J - 1] - SX[J - 1];
    const int dy = TY[J - 1] - SY[J - 1];
    if (!(0 <= dy && dy <= dx)) {
      return 0;
    }
  }
  vector<vector<Mint>> a(J, vector<Mint>(J));
  for (int j1 = 0; j1 < J; ++j1) {
    a[0][j1] = dp0[TX[j1]][TY[j1] - Y0];
  }
  for (int j0 = 1; j0 < J; ++j0) for (int j1 = 0; j1 < J; ++j1) {
    a[j0][j1] = dp[SY[j0] - Y0][TX[j1]][TY[j1] - Y0];
  }
  const Mint res = det(a);
// cerr<<COLOR("32")<<"[solve]"<<COLOR()<<endl;
// cerr<<"SX = "<<SX<<", TX = "<<TX<<endl;
// cerr<<"SY = "<<SY<<", TY = "<<TY<<endl;
// cerr<<"a = "<<a<<endl;
// cerr<<"res = "<<res<<endl;
  return res;
}

// s: s[j - 1]
Mint dfs(int j, int s) {
  if (j == J) {
    return solve();
  } else {
    Mint ret = 0;
    for (int ss = s; ss < s + K/2; ++ss) {
      TY[j - 1] = ss - (j - 1) * (K/2);
      SY[j] = ss - j * (K/2);
      ret += dfs(j + 1, ss);
    }
    return ret;
  }
}

Mint run() {
  J = (N + K - 1) / K;
  Y0 = -(J - 1) * (K/2);
  Y1 = K/2;
cerr<<"J = "<<J<<", Y0 = "<<Y0<<", Y1 = "<<Y1<<endl;
  // Y1 - Y0 <= J (K/2) < (N/K + 1) (K/2) < N/2 + K/2 < N
  assert(Y1 - Y0 <= N);
  SX.assign(J, 0);
  SY.assign(J, 1001001001);
  TX.assign(J, K);
  TY.assign(J, 1001001001);
  SX[0] = M;
  TX[J - 1] = N - (J - 1) * K;
  Mint ans = 0;
  for (int few = 0; few < 2; ++few) {
// cerr<<COLOR("93")<<"few = "<<few<<COLOR()<<endl;
    SY[0] = count(S, S + M, '0' + few);
    for (int &ty = TY[J - 1] = Y0; ty <= -(J - 1) + min(TX[J - 1], K/2 - 1); ++ty) {
// cerr<<"  ty = "<<ty<<endl;
      // ban to ensure non-intersecting <=> id perm
      memset(ban, 0, sizeof(ban));
      for (int y = SY[0] + 1; y <= Y1; ++y) ban[SX[0]][y - Y0] = true;
      for (int y = Y0; y < TY[J - 1]; ++y) ban[TX[J - 1]][y - Y0] = true;
      {
        int y = 0;
        for (int x = 0; x < M; ++x) {
          ban[x][y - Y0] = true;
          if (S[x] - '0' == few) ++y;
        }
      }
// cerr<<"    SX = "<<SX<<", TX = "<<TX<<endl;
// cerr<<"    SY = "<<SY<<", TY = "<<TY<<endl;
// cerr<<"    ban = "<<endl;for(int x=0;x<=K;++x){cerr<<"    ";pv(ban[x],ban[x]+(Y1-Y0+1));}
      memset(dp0, 0, sizeof(dp0));
      memset(dp, 0, sizeof(dp));
      doDP(SX[0], SY[0], dp0);
      for (int y = Y0; y <= Y1; ++y) {
        doDP(0, y, dp[y - Y0]);
      }
      ans += dfs(1, 0);
    }
  }
  return ans;
}
}  // large_k


int main() {
  for (; ~scanf("%d%d%d", &N, &K, &M); ) {
    if (M) {
      scanf("%s", S);
    } else {
      S[0] = 0;
    }
cerr<<COLOR("33")<<"N = "<<N<<", K = "<<K<<", M = "<<M<<", S = "<<S<<COLOR()<<endl;
    
    Mint ans = 0;
    if (K <= 20) {
      ans = small_k::run();
    } else {
      ans = large_k::run();
    }
    printf("%u\n", ans.x);
#ifdef LOCAL
const Mint brt=small_k::run();
if(brt!=ans)cerr<<N<<" "<<K<<" "<<M<<" "<<S<<": "<<brt<<" "<<ans<<endl;
assert(brt==ans);
#endif
  }
  return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 10
Accepted

Test #1:

score: 10
Accepted
time: 1ms
memory: 3704kb

input:

2 2 0

output:

2

result:

ok 1 number(s): "2"

Test #2:

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

input:

2 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #3:

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

input:

3 2 0

output:

2

result:

ok 1 number(s): "2"

Test #4:

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

input:

3 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #5:

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

input:

4 2 0

output:

2

result:

ok 1 number(s): "2"

Test #6:

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

input:

4 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #7:

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

input:

4 4 0

output:

10

result:

ok 1 number(s): "10"

Test #8:

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

input:

4 4 1
1

output:

5

result:

ok 1 number(s): "5"

Test #9:

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

input:

4 4 2
00

output:

3

result:

ok 1 number(s): "3"

Test #10:

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

input:

4 4 3
101

output:

1

result:

ok 1 number(s): "1"

Test #11:

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

input:

5 2 0

output:

2

result:

ok 1 number(s): "2"

Test #12:

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

input:

5 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #13:

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

input:

5 4 0

output:

14

result:

ok 1 number(s): "14"

Test #14:

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

input:

5 4 1
0

output:

7

result:

ok 1 number(s): "7"

Test #15:

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

input:

5 4 2
01

output:

3

result:

ok 1 number(s): "3"

Test #16:

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

input:

5 4 3
110

output:

1

result:

ok 1 number(s): "1"

Test #17:

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

input:

17 2 0

output:

2

result:

ok 1 number(s): "2"

Test #18:

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

input:

17 2 0

output:

2

result:

ok 1 number(s): "2"

Test #19:

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

input:

17 10 6
110111

output:

621

result:

ok 1 number(s): "621"

Test #20:

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

input:

17 10 2
11

output:

8413

result:

ok 1 number(s): "8413"

Test #21:

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

input:

18 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #22:

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

input:

18 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #23:

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

input:

18 8 5
00010

output:

918

result:

ok 1 number(s): "918"

Test #24:

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

input:

18 8 3
001

output:

3404

result:

ok 1 number(s): "3404"

Test #25:

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

input:

18 16 6
100011

output:

2458

result:

ok 1 number(s): "2458"

Test #26:

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

input:

18 16 8
00101101

output:

548

result:

ok 1 number(s): "548"

Test #27:

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

input:

19 2 1
1

output:

1

result:

ok 1 number(s): "1"

Test #28:

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

input:

19 2 0

output:

2

result:

ok 1 number(s): "2"

Test #29:

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

input:

19 6 2
00

output:

3413

result:

ok 1 number(s): "3413"

Test #30:

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

input:

19 6 1
1

output:

7012

result:

ok 1 number(s): "7012"

Test #31:

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

input:

19 12 10
1010110000

output:

266

result:

ok 1 number(s): "266"

Test #32:

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

input:

19 12 3
111

output:

19234

result:

ok 1 number(s): "19234"

Test #33:

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

input:

19 16 2
10

output:

77876

result:

ok 1 number(s): "77876"

Test #34:

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

input:

19 16 0

output:

301208

result:

ok 1 number(s): "301208"

Test #35:

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

input:

20 2 1
0

output:

1

result:

ok 1 number(s): "1"

Test #36:

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

input:

20 2 0

output:

2

result:

ok 1 number(s): "2"

Test #37:

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

input:

20 10 9
110111000

output:

76

result:

ok 1 number(s): "76"

Test #38:

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

input:

20 10 9
110101110

output:

372

result:

ok 1 number(s): "372"

Test #39:

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

input:

20 14 11
10110110000

output:

207

result:

ok 1 number(s): "207"

Test #40:

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

input:

20 14 7
0011011

output:

3675

result:

ok 1 number(s): "3675"

Test #41:

score: 0
Accepted
time: 28ms
memory: 10308kb

input:

20 20 14
10111010000000

output:

58

result:

ok 1 number(s): "58"

Subtask #2:

score: 10
Accepted

Dependency #1:

100%
Accepted

Test #42:

score: 10
Accepted
time: 1ms
memory: 3804kb

input:

114 12 11
11010000010

output:

394940507

result:

ok 1 number(s): "394940507"

Test #43:

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

input:

114 12 2
01

output:

60509873

result:

ok 1 number(s): "60509873"

Test #44:

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

input:

114 14 10
1001111011

output:

154687039

result:

ok 1 number(s): "154687039"

Test #45:

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

input:

114 14 5
00100

output:

941826071

result:

ok 1 number(s): "941826071"

Test #46:

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

input:

114 16 10
1011101001

output:

391666362

result:

ok 1 number(s): "391666362"

Test #47:

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

input:

114 16 15
000010011111010

output:

599226561

result:

ok 1 number(s): "599226561"

Test #48:

score: 0
Accepted
time: 53ms
memory: 5032kb

input:

114 18 1
0

output:

167675624

result:

ok 1 number(s): "167675624"

Test #49:

score: 0
Accepted
time: 50ms
memory: 5004kb

input:

114 18 8
11000001

output:

165986235

result:

ok 1 number(s): "165986235"

Test #50:

score: 0
Accepted
time: 196ms
memory: 10332kb

input:

114 20 17
11101000010011010

output:

852476378

result:

ok 1 number(s): "852476378"

Test #51:

score: 0
Accepted
time: 195ms
memory: 10252kb

input:

114 20 13
1101011010000

output:

974712368

result:

ok 1 number(s): "974712368"

Test #52:

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

input:

113 12 8
10101100

output:

754580060

result:

ok 1 number(s): "754580060"

Test #53:

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

input:

113 12 10
1110010010

output:

928476173

result:

ok 1 number(s): "928476173"

Test #54:

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

input:

113 14 9
010111000

output:

930953494

result:

ok 1 number(s): "930953494"

Test #55:

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

input:

113 14 0

output:

613264431

result:

ok 1 number(s): "613264431"

Test #56:

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

input:

113 16 4
0011

output:

966491874

result:

ok 1 number(s): "966491874"

Test #57:

score: 0
Accepted
time: 12ms
memory: 3968kb

input:

113 16 10
1110110011

output:

71975445

result:

ok 1 number(s): "71975445"

Test #58:

score: 0
Accepted
time: 46ms
memory: 4956kb

input:

113 18 2
01

output:

35416931

result:

ok 1 number(s): "35416931"

Test #59:

score: 0
Accepted
time: 49ms
memory: 5080kb

input:

113 18 11
01101011111

output:

605684813

result:

ok 1 number(s): "605684813"

Test #60:

score: 0
Accepted
time: 202ms
memory: 10404kb

input:

113 20 1
1

output:

970488755

result:

ok 1 number(s): "970488755"

Test #61:

score: 0
Accepted
time: 192ms
memory: 10284kb

input:

113 20 17
10000001101111001

output:

308768022

result:

ok 1 number(s): "308768022"

Test #62:

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

input:

112 12 10
1011100000

output:

379472486

result:

ok 1 number(s): "379472486"

Test #63:

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

input:

112 12 3
111

output:

876338776

result:

ok 1 number(s): "876338776"

Test #64:

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

input:

112 14 6
100111

output:

850899867

result:

ok 1 number(s): "850899867"

Test #65:

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

input:

112 14 11
11011001011

output:

579315503

result:

ok 1 number(s): "579315503"

Test #66:

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

input:

112 16 11
00000111111

output:

827780781

result:

ok 1 number(s): "827780781"

Test #67:

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

input:

112 16 9
101001101

output:

247916257

result:

ok 1 number(s): "247916257"

Test #68:

score: 0
Accepted
time: 44ms
memory: 5056kb

input:

112 18 16
0011000001111001

output:

740632908

result:

ok 1 number(s): "740632908"

Test #69:

score: 0
Accepted
time: 46ms
memory: 4960kb

input:

112 18 4
0010

output:

594108528

result:

ok 1 number(s): "594108528"

Test #70:

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

input:

112 20 7
1010100

output:

818166882

result:

ok 1 number(s): "818166882"

Test #71:

score: 0
Accepted
time: 196ms
memory: 10396kb

input:

112 20 16
0001100100101000

output:

222914924

result:

ok 1 number(s): "222914924"

Test #72:

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

input:

111 12 2
11

output:

895626591

result:

ok 1 number(s): "895626591"

Test #73:

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

input:

111 12 1
1

output:

543447881

result:

ok 1 number(s): "543447881"

Test #74:

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

input:

111 14 3
111

output:

555958815

result:

ok 1 number(s): "555958815"

Test #75:

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

input:

111 14 13
1110001101010

output:

47749667

result:

ok 1 number(s): "47749667"

Test #76:

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

input:

111 16 5
01000

output:

880732287

result:

ok 1 number(s): "880732287"

Test #77:

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

input:

111 16 7
0110010

output:

153134396

result:

ok 1 number(s): "153134396"

Test #78:

score: 0
Accepted
time: 44ms
memory: 5000kb

input:

111 18 17
11011101001111100

output:

718197735

result:

ok 1 number(s): "718197735"

Test #79:

score: 0
Accepted
time: 48ms
memory: 4972kb

input:

111 18 9
011110101

output:

78875109

result:

ok 1 number(s): "78875109"

Test #80:

score: 0
Accepted
time: 198ms
memory: 10240kb

input:

111 20 6
100101

output:

484008568

result:

ok 1 number(s): "484008568"

Test #81:

score: 0
Accepted
time: 194ms
memory: 10276kb

input:

111 20 19
1100110110001010110

output:

612558978

result:

ok 1 number(s): "612558978"

Test #82:

score: 0
Accepted
time: 175ms
memory: 10276kb

input:

102 20 10
0101000100

output:

678899105

result:

ok 1 number(s): "678899105"

Test #83:

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

input:

97 16 13
0101110011010

output:

456291266

result:

ok 1 number(s): "456291266"

Subtask #3:

score: 30
Accepted

Dependency #1:

100%
Accepted

Test #84:

score: 30
Accepted
time: 116ms
memory: 10252kb

input:

66 20 5
11001

output:

286180948

result:

ok 1 number(s): "286180948"

Test #85:

score: 0
Accepted
time: 112ms
memory: 10232kb

input:

66 20 19
0101001111011100100

output:

334317215

result:

ok 1 number(s): "334317215"

Test #86:

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

input:

66 22 19
1001101100000100001

output:

465510840

result:

ok 1 number(s): "465510840"

Test #87:

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

input:

66 22 11
10001111000

output:

731812403

result:

ok 1 number(s): "731812403"

Test #88:

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

input:

66 24 6
011111

output:

270615978

result:

ok 1 number(s): "270615978"

Test #89:

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

input:

66 24 6
010001

output:

800866476

result:

ok 1 number(s): "800866476"

Test #90:

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

input:

66 26 11
01110011011

output:

292876310

result:

ok 1 number(s): "292876310"

Test #91:

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

input:

66 26 3
110

output:

269818127

result:

ok 1 number(s): "269818127"

Test #92:

score: 0
Accepted
time: 26ms
memory: 10440kb

input:

66 28 22
1111000101010111010110

output:

25687950

result:

ok 1 number(s): "25687950"

Test #93:

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

input:

66 28 7
0010101

output:

21960392

result:

ok 1 number(s): "21960392"

Test #94:

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

input:

66 30 16
1111000000011010

output:

599613456

result:

ok 1 number(s): "599613456"

Test #95:

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

input:

66 30 22
0010101110011001011100

output:

332331060

result:

ok 1 number(s): "332331060"

Test #96:

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

input:

66 32 12
011100101111

output:

692517940

result:

ok 1 number(s): "692517940"

Test #97:

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

input:

66 32 16
0100100100101001

output:

967944648

result:

ok 1 number(s): "967944648"

Test #98:

score: 0
Accepted
time: 116ms
memory: 10280kb

input:

65 20 1
1

output:

42155886

result:

ok 1 number(s): "42155886"

Test #99:

score: 0
Accepted
time: 115ms
memory: 10356kb

input:

65 20 17
10010110011011111

output:

178005033

result:

ok 1 number(s): "178005033"

Test #100:

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

input:

65 22 16
0001011100100000

output:

785335838

result:

ok 1 number(s): "785335838"

Test #101:

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

input:

65 22 13
1001101010101

output:

440523928

result:

ok 1 number(s): "440523928"

Test #102:

score: 0
Accepted
time: 22ms
memory: 10532kb

input:

65 24 0

output:

477090711

result:

ok 1 number(s): "477090711"

Test #103:

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

input:

65 24 14
10111111011101

output:

263900154

result:

ok 1 number(s): "263900154"

Test #104:

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

input:

65 26 10
1100111010

output:

343121911

result:

ok 1 number(s): "343121911"

Test #105:

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

input:

65 26 2
01

output:

1028654

result:

ok 1 number(s): "1028654"

Test #106:

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

input:

65 28 11
00010110101

output:

977003245

result:

ok 1 number(s): "977003245"

Test #107:

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

input:

65 28 25
1010000011011011000010010

output:

59779597

result:

ok 1 number(s): "59779597"

Test #108:

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

input:

65 30 12
011010110110

output:

28981686

result:

ok 1 number(s): "28981686"

Test #109:

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

input:

65 30 5
01111

output:

901067934

result:

ok 1 number(s): "901067934"

Test #110:

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

input:

65 32 9
101100011

output:

523898023

result:

ok 1 number(s): "523898023"

Test #111:

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

input:

65 32 31
1010100001010000110110000001000

output:

173664576

result:

ok 1 number(s): "173664576"

Test #112:

score: 0
Accepted
time: 109ms
memory: 10260kb

input:

64 20 2
10

output:

213928626

result:

ok 1 number(s): "213928626"

Test #113:

score: 0
Accepted
time: 104ms
memory: 10252kb

input:

64 20 17
01110111010001000

output:

629845990

result:

ok 1 number(s): "629845990"

Test #114:

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

input:

64 22 4
0101

output:

755608618

result:

ok 1 number(s): "755608618"

Test #115:

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

input:

64 22 20
00010010100011111010

output:

381748139

result:

ok 1 number(s): "381748139"

Test #116:

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

input:

64 24 9
100110100

output:

508203808

result:

ok 1 number(s): "508203808"

Test #117:

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

input:

64 24 17
11100000110000111

output:

271951917

result:

ok 1 number(s): "271951917"

Test #118:

score: 0
Accepted
time: 22ms
memory: 10552kb

input:

64 26 16
1100111111111110

output:

947719454

result:

ok 1 number(s): "947719454"

Test #119:

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

input:

64 26 18
101001101111101011

output:

557651914

result:

ok 1 number(s): "557651914"

Test #120:

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

input:

64 28 7
0011101

output:

659928242

result:

ok 1 number(s): "659928242"

Test #121:

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

input:

64 28 10
1100010011

output:

724166061

result:

ok 1 number(s): "724166061"

Test #122:

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

input:

64 30 2
10

output:

922542306

result:

ok 1 number(s): "922542306"

Test #123:

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

input:

64 30 2
10

output:

922542306

result:

ok 1 number(s): "922542306"

Test #124:

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

input:

64 32 14
00100000110010

output:

772135024

result:

ok 1 number(s): "772135024"

Test #125:

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

input:

64 32 19
0110111111001010010

output:

301836349

result:

ok 1 number(s): "301836349"

Test #126:

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

input:

66 48 10
1100101011

output:

250609010

result:

ok 1 number(s): "250609010"

Test #127:

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

input:

66 66 29
01110011011101001000011110101

output:

746018049

result:

ok 1 number(s): "746018049"

Test #128:

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

input:

66 14 7
1001101

output:

871164400

result:

ok 1 number(s): "871164400"

Test #129:

score: 0
Accepted
time: 22ms
memory: 10508kb

input:

66 24 1
0

output:

584525706

result:

ok 1 number(s): "584525706"

Test #130:

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

input:

66 24 2
11

output:

317970168

result:

ok 1 number(s): "317970168"

Test #131:

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

input:

66 26 1
0

output:

391681574

result:

ok 1 number(s): "391681574"

Test #132:

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

input:

66 26 2
00

output:

97862478

result:

ok 1 number(s): "97862478"

Test #133:

score: 0
Accepted
time: 22ms
memory: 10556kb

input:

66 28 1
0

output:

964005824

result:

ok 1 number(s): "964005824"

Test #134:

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

input:

66 28 2
11

output:

521812451

result:

ok 1 number(s): "521812451"

Test #135:

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

input:

57 24 10
0111100111

output:

275357201

result:

ok 1 number(s): "275357201"

Test #136:

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

input:

57 56 13
0111001000100

output:

712420784

result:

ok 1 number(s): "712420784"

Subtask #4:

score: 20
Accepted

Test #137:

score: 20
Accepted
time: 204ms
memory: 10288kb

input:

114 20 0

output:

849724285

result:

ok 1 number(s): "849724285"

Test #138:

score: 0
Accepted
time: 1123ms
memory: 10512kb

input:

114 22 0

output:

918046462

result:

ok 1 number(s): "918046462"

Test #139:

score: 0
Accepted
time: 444ms
memory: 10532kb

input:

114 24 0

output:

471169566

result:

ok 1 number(s): "471169566"

Test #140:

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

input:

114 26 0

output:

540055361

result:

ok 1 number(s): "540055361"

Test #141:

score: 0
Accepted
time: 177ms
memory: 10488kb

input:

114 28 0

output:

997530597

result:

ok 1 number(s): "997530597"

Test #142:

score: 0
Accepted
time: 103ms
memory: 10492kb

input:

114 30 0

output:

37439521

result:

ok 1 number(s): "37439521"

Test #143:

score: 0
Accepted
time: 111ms
memory: 10440kb

input:

114 32 0

output:

448438493

result:

ok 1 number(s): "448438493"

Test #144:

score: 0
Accepted
time: 203ms
memory: 10280kb

input:

113 20 0

output:

942733157

result:

ok 1 number(s): "942733157"

Test #145:

score: 0
Accepted
time: 919ms
memory: 10504kb

input:

113 22 0

output:

547536565

result:

ok 1 number(s): "547536565"

Test #146:

score: 0
Accepted
time: 419ms
memory: 10504kb

input:

113 24 0

output:

219952878

result:

ok 1 number(s): "219952878"

Test #147:

score: 0
Accepted
time: 357ms
memory: 10516kb

input:

113 26 0

output:

763274765

result:

ok 1 number(s): "763274765"

Test #148:

score: 0
Accepted
time: 134ms
memory: 10492kb

input:

113 28 0

output:

910952876

result:

ok 1 number(s): "910952876"

Test #149:

score: 0
Accepted
time: 107ms
memory: 10560kb

input:

113 30 0

output:

968408969

result:

ok 1 number(s): "968408969"

Test #150:

score: 0
Accepted
time: 113ms
memory: 10516kb

input:

113 32 0

output:

118567934

result:

ok 1 number(s): "118567934"

Test #151:

score: 0
Accepted
time: 197ms
memory: 10280kb

input:

112 20 0

output:

275087743

result:

ok 1 number(s): "275087743"

Test #152:

score: 0
Accepted
time: 713ms
memory: 10512kb

input:

112 22 0

output:

185644824

result:

ok 1 number(s): "185644824"

Test #153:

score: 0
Accepted
time: 406ms
memory: 10496kb

input:

112 24 0

output:

557785519

result:

ok 1 number(s): "557785519"

Test #154:

score: 0
Accepted
time: 337ms
memory: 10552kb

input:

112 26 0

output:

522996775

result:

ok 1 number(s): "522996775"

Test #155:

score: 0
Accepted
time: 92ms
memory: 10504kb

input:

112 28 0

output:

134122652

result:

ok 1 number(s): "134122652"

Test #156:

score: 0
Accepted
time: 99ms
memory: 10556kb

input:

112 30 0

output:

502459554

result:

ok 1 number(s): "502459554"

Test #157:

score: 0
Accepted
time: 115ms
memory: 10504kb

input:

112 32 0

output:

169309797

result:

ok 1 number(s): "169309797"

Test #158:

score: 0
Accepted
time: 195ms
memory: 10268kb

input:

111 20 0

output:

360310827

result:

ok 1 number(s): "360310827"

Test #159:

score: 0
Accepted
time: 508ms
memory: 10516kb

input:

111 22 0

output:

516490684

result:

ok 1 number(s): "516490684"

Test #160:

score: 0
Accepted
time: 389ms
memory: 10532kb

input:

111 24 0

output:

501679698

result:

ok 1 number(s): "501679698"

Test #161:

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

input:

111 26 0

output:

43788136

result:

ok 1 number(s): "43788136"

Test #162:

score: 0
Accepted
time: 86ms
memory: 10508kb

input:

111 28 0

output:

5764962

result:

ok 1 number(s): "5764962"

Test #163:

score: 0
Accepted
time: 95ms
memory: 10524kb

input:

111 30 0

output:

918617250

result:

ok 1 number(s): "918617250"

Test #164:

score: 0
Accepted
time: 98ms
memory: 10440kb

input:

111 32 0

output:

982496307

result:

ok 1 number(s): "982496307"

Test #165:

score: 0
Accepted
time: 29ms
memory: 10556kb

input:

114 114 0

output:

321821768

result:

ok 1 number(s): "321821768"

Test #166:

score: 0
Accepted
time: 61ms
memory: 10440kb

input:

114 50 0

output:

860957763

result:

ok 1 number(s): "860957763"

Test #167:

score: 0
Accepted
time: 54ms
memory: 10556kb

input:

113 50 0

output:

307614098

result:

ok 1 number(s): "307614098"

Test #168:

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

input:

110 10 0

output:

615608372

result:

ok 1 number(s): "615608372"

Test #169:

score: 0
Accepted
time: 34ms
memory: 10516kb

input:

100 50 0

output:

475715516

result:

ok 1 number(s): "475715516"

Test #170:

score: 0
Accepted
time: 67ms
memory: 10504kb

input:

111 78 0

output:

617855013

result:

ok 1 number(s): "617855013"

Test #171:

score: 0
Accepted
time: 66ms
memory: 10508kb

input:

100 26 0

output:

960228335

result:

ok 1 number(s): "960228335"

Test #172:

score: 0
Accepted
time: 77ms
memory: 10492kb

input:

99 28 0

output:

17612739

result:

ok 1 number(s): "17612739"

Test #173:

score: 0
Accepted
time: 82ms
memory: 10492kb

input:

107 28 0

output:

462764365

result:

ok 1 number(s): "462764365"

Subtask #5:

score: 30
Accepted

Dependency #2:

100%
Accepted

Dependency #3:

100%
Accepted

Dependency #4:

100%
Accepted

Test #174:

score: 30
Accepted
time: 196ms
memory: 10348kb

input:

114 20 18
010001110011101110

output:

431763994

result:

ok 1 number(s): "431763994"

Test #175:

score: 0
Accepted
time: 198ms
memory: 10304kb

input:

114 20 12
110101100011

output:

470786738

result:

ok 1 number(s): "470786738"

Test #176:

score: 0
Accepted
time: 1173ms
memory: 10608kb

input:

114 22 7
1100100

output:

919768004

result:

ok 1 number(s): "919768004"

Test #177:

score: 0
Accepted
time: 1148ms
memory: 10516kb

input:

114 22 3
110

output:

733683474

result:

ok 1 number(s): "733683474"

Test #178:

score: 0
Accepted
time: 449ms
memory: 10576kb

input:

114 24 9
101100111

output:

110355146

result:

ok 1 number(s): "110355146"

Test #179:

score: 0
Accepted
time: 468ms
memory: 10604kb

input:

114 24 14
10010001001100

output:

424862447

result:

ok 1 number(s): "424862447"

Test #180:

score: 0
Accepted
time: 406ms
memory: 10492kb

input:

114 26 10
1000110000

output:

692980549

result:

ok 1 number(s): "692980549"

Test #181:

score: 0
Accepted
time: 389ms
memory: 10512kb

input:

114 26 0

output:

540055361

result:

ok 1 number(s): "540055361"

Test #182:

score: 0
Accepted
time: 186ms
memory: 10508kb

input:

114 28 13
0110010000101

output:

198840825

result:

ok 1 number(s): "198840825"

Test #183:

score: 0
Accepted
time: 208ms
memory: 10500kb

input:

114 28 21
011101001001001110101

output:

536992260

result:

ok 1 number(s): "536992260"

Test #184:

score: 0
Accepted
time: 104ms
memory: 10508kb

input:

114 30 5
11111

output:

537218122

result:

ok 1 number(s): "537218122"

Test #185:

score: 0
Accepted
time: 108ms
memory: 10556kb

input:

114 30 4
0111

output:

112913838

result:

ok 1 number(s): "112913838"

Test #186:

score: 0
Accepted
time: 113ms
memory: 10608kb

input:

114 32 24
111011011110101111101110

output:

410674366

result:

ok 1 number(s): "410674366"

Test #187:

score: 0
Accepted
time: 108ms
memory: 10556kb

input:

114 32 24
001110001000100100000001

output:

857522878

result:

ok 1 number(s): "857522878"

Test #188:

score: 0
Accepted
time: 103ms
memory: 10440kb

input:

114 34 23
11110011110011000100000

output:

258724742

result:

ok 1 number(s): "258724742"

Test #189:

score: 0
Accepted
time: 103ms
memory: 10508kb

input:

114 34 29
01000110000011110001100101111

output:

428986471

result:

ok 1 number(s): "428986471"

Test #190:

score: 0
Accepted
time: 84ms
memory: 10564kb

input:

114 36 21
011101100000110110110

output:

610291259

result:

ok 1 number(s): "610291259"

Test #191:

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

input:

114 36 21
111001111000111000001

output:

125280689

result:

ok 1 number(s): "125280689"

Test #192:

score: 0
Accepted
time: 44ms
memory: 10508kb

input:

114 38 34
1000000000111011000110010000100111

output:

311189243

result:

ok 1 number(s): "311189243"

Test #193:

score: 0
Accepted
time: 45ms
memory: 10488kb

input:

114 38 22
1010000101110101000101

output:

910759321

result:

ok 1 number(s): "910759321"

Test #194:

score: 0
Accepted
time: 53ms
memory: 10512kb

input:

114 40 19
0000110111111011001

output:

725392899

result:

ok 1 number(s): "725392899"

Test #195:

score: 0
Accepted
time: 46ms
memory: 10508kb

input:

114 40 1
0

output:

186660409

result:

ok 1 number(s): "186660409"

Test #196:

score: 0
Accepted
time: 208ms
memory: 10352kb

input:

113 20 0

output:

942733157

result:

ok 1 number(s): "942733157"

Test #197:

score: 0
Accepted
time: 202ms
memory: 10276kb

input:

113 20 0

output:

942733157

result:

ok 1 number(s): "942733157"

Test #198:

score: 0
Accepted
time: 1032ms
memory: 10556kb

input:

113 22 18
000100010001010001

output:

59793949

result:

ok 1 number(s): "59793949"

Test #199:

score: 0
Accepted
time: 1047ms
memory: 10516kb

input:

113 22 21
111000101011110000010

output:

553780760

result:

ok 1 number(s): "553780760"

Test #200:

score: 0
Accepted
time: 432ms
memory: 10528kb

input:

113 24 12
001000000110

output:

988124004

result:

ok 1 number(s): "988124004"

Test #201:

score: 0
Accepted
time: 423ms
memory: 10516kb

input:

113 24 4
1001

output:

937565048

result:

ok 1 number(s): "937565048"

Test #202:

score: 0
Accepted
time: 381ms
memory: 10504kb

input:

113 26 18
000101000001101010

output:

491079106

result:

ok 1 number(s): "491079106"

Test #203:

score: 0
Accepted
time: 363ms
memory: 10576kb

input:

113 26 2
01

output:

835739975

result:

ok 1 number(s): "835739975"

Test #204:

score: 0
Accepted
time: 140ms
memory: 10556kb

input:

113 28 24
000100000001000101011001

output:

656600493

result:

ok 1 number(s): "656600493"

Test #205:

score: 0
Accepted
time: 140ms
memory: 10500kb

input:

113 28 14
10001110100100

output:

744343488

result:

ok 1 number(s): "744343488"

Test #206:

score: 0
Accepted
time: 105ms
memory: 10536kb

input:

113 30 2
00

output:

440364168

result:

ok 1 number(s): "440364168"

Test #207:

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

input:

113 30 29
00000110100010111111110110111

output:

495866630

result:

ok 1 number(s): "495866630"

Test #208:

score: 0
Accepted
time: 105ms
memory: 10516kb

input:

113 32 7
1111010

output:

802577059

result:

ok 1 number(s): "802577059"

Test #209:

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

input:

113 32 19
0010101100010000100

output:

777334708

result:

ok 1 number(s): "777334708"

Test #210:

score: 0
Accepted
time: 103ms
memory: 10532kb

input:

113 34 2
10

output:

892948233

result:

ok 1 number(s): "892948233"

Test #211:

score: 0
Accepted
time: 102ms
memory: 10560kb

input:

113 34 19
0111111011110001100

output:

788299719

result:

ok 1 number(s): "788299719"

Test #212:

score: 0
Accepted
time: 78ms
memory: 10504kb

input:

113 36 35
01010011000001101010001010001100000

output:

446293388

result:

ok 1 number(s): "446293388"

Test #213:

score: 0
Accepted
time: 76ms
memory: 10560kb

input:

113 36 17
10101110011101011

output:

933906653

result:

ok 1 number(s): "933906653"

Test #214:

score: 0
Accepted
time: 40ms
memory: 10512kb

input:

113 38 29
10110101010100100111000100110

output:

479464915

result:

ok 1 number(s): "479464915"

Test #215:

score: 0
Accepted
time: 45ms
memory: 10556kb

input:

113 38 1
0

output:

330683275

result:

ok 1 number(s): "330683275"

Test #216:

score: 0
Accepted
time: 53ms
memory: 10516kb

input:

113 40 33
000100011111110100010101111000111

output:

444203154

result:

ok 1 number(s): "444203154"

Test #217:

score: 0
Accepted
time: 53ms
memory: 10556kb

input:

113 40 38
11000110110000011100101111111001111110

output:

940896260

result:

ok 1 number(s): "940896260"

Test #218:

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

input:

112 20 15
100101111010100

output:

936505516

result:

ok 1 number(s): "936505516"

Test #219:

score: 0
Accepted
time: 201ms
memory: 10276kb

input:

112 20 4
1010

output:

49855096

result:

ok 1 number(s): "49855096"

Test #220:

score: 0
Accepted
time: 734ms
memory: 10512kb

input:

112 22 3
000

output:

118501267

result:

ok 1 number(s): "118501267"

Test #221:

score: 0
Accepted
time: 734ms
memory: 10564kb

input:

112 22 5
00110

output:

486237703

result:

ok 1 number(s): "486237703"

Test #222:

score: 0
Accepted
time: 407ms
memory: 10524kb

input:

112 24 3
111

output:

185640510

result:

ok 1 number(s): "185640510"

Test #223:

score: 0
Accepted
time: 408ms
memory: 10524kb

input:

112 24 7
1011110

output:

812252525

result:

ok 1 number(s): "812252525"

Test #224:

score: 0
Accepted
time: 349ms
memory: 10512kb

input:

112 26 22
1110100110001011010010

output:

996684191

result:

ok 1 number(s): "996684191"

Test #225:

score: 0
Accepted
time: 359ms
memory: 10512kb

input:

112 26 23
00111010001110110001101

output:

447874952

result:

ok 1 number(s): "447874952"

Test #226:

score: 0
Accepted
time: 84ms
memory: 10556kb

input:

112 28 2
10

output:

789348924

result:

ok 1 number(s): "789348924"

Test #227:

score: 0
Accepted
time: 87ms
memory: 10536kb

input:

112 28 22
0111001011011011001110

output:

276244451

result:

ok 1 number(s): "276244451"

Test #228:

score: 0
Accepted
time: 100ms
memory: 10492kb

input:

112 30 24
011000100011011010000101

output:

130206966

result:

ok 1 number(s): "130206966"

Test #229:

score: 0
Accepted
time: 103ms
memory: 10516kb

input:

112 30 25
0001010000001010101011011

output:

298519905

result:

ok 1 number(s): "298519905"

Test #230:

score: 0
Accepted
time: 107ms
memory: 10512kb

input:

112 32 11
11000110011

output:

113144671

result:

ok 1 number(s): "113144671"

Test #231:

score: 0
Accepted
time: 104ms
memory: 10504kb

input:

112 32 8
01000100

output:

77947278

result:

ok 1 number(s): "77947278"

Test #232:

score: 0
Accepted
time: 91ms
memory: 10532kb

input:

112 34 23
11100100100101010110010

output:

242910396

result:

ok 1 number(s): "242910396"

Test #233:

score: 0
Accepted
time: 92ms
memory: 10512kb

input:

112 34 6
101010

output:

324136975

result:

ok 1 number(s): "324136975"

Test #234:

score: 0
Accepted
time: 71ms
memory: 10512kb

input:

112 36 27
011000110111000001010111000

output:

347154171

result:

ok 1 number(s): "347154171"

Test #235:

score: 0
Accepted
time: 74ms
memory: 10516kb

input:

112 36 4
0010

output:

897567351

result:

ok 1 number(s): "897567351"

Test #236:

score: 0
Accepted
time: 50ms
memory: 10504kb

input:

112 38 9
011000110

output:

873144090

result:

ok 1 number(s): "873144090"

Test #237:

score: 0
Accepted
time: 44ms
memory: 10564kb

input:

112 38 1
1

output:

746799650

result:

ok 1 number(s): "746799650"

Test #238:

score: 0
Accepted
time: 54ms
memory: 10604kb

input:

112 40 9
100110000

output:

839660260

result:

ok 1 number(s): "839660260"

Test #239:

score: 0
Accepted
time: 54ms
memory: 10608kb

input:

112 40 5
11111

output:

132679752

result:

ok 1 number(s): "132679752"

Test #240:

score: 0
Accepted
time: 50ms
memory: 10472kb

input:

114 60 34
0100010001000010100101000001110010

output:

985171018

result:

ok 1 number(s): "985171018"

Test #241:

score: 0
Accepted
time: 62ms
memory: 10512kb

input:

114 64 32
01011111011101010010101011001001

output:

219116701

result:

ok 1 number(s): "219116701"

Test #242:

score: 0
Accepted
time: 67ms
memory: 10500kb

input:

114 68 24
010101111110101100010110

output:

685568642

result:

ok 1 number(s): "685568642"

Test #243:

score: 0
Accepted
time: 82ms
memory: 10436kb

input:

114 72 20
10100101110111101111

output:

651180307

result:

ok 1 number(s): "651180307"

Test #244:

score: 0
Accepted
time: 88ms
memory: 10512kb

input:

114 76 22
0111000111111000101100

output:

292012815

result:

ok 1 number(s): "292012815"

Test #245:

score: 0
Accepted
time: 96ms
memory: 10532kb

input:

114 80 42
010101111000100001010101010011110111101101

output:

755652301

result:

ok 1 number(s): "755652301"

Test #246:

score: 0
Accepted
time: 51ms
memory: 10532kb

input:

113 60 32
11100111101010010001000010101111

output:

83356606

result:

ok 1 number(s): "83356606"

Test #247:

score: 0
Accepted
time: 59ms
memory: 10580kb

input:

113 64 9
011100111

output:

711428109

result:

ok 1 number(s): "711428109"

Test #248:

score: 0
Accepted
time: 67ms
memory: 10504kb

input:

113 68 51
100011010001001111000000111100000110001110001010011

output:

797133347

result:

ok 1 number(s): "797133347"

Test #249:

score: 0
Accepted
time: 76ms
memory: 10504kb

input:

113 72 2
00

output:

330654705

result:

ok 1 number(s): "330654705"

Test #250:

score: 0
Accepted
time: 88ms
memory: 10440kb

input:

113 76 70
0111010001000011010100011100001111010000000001100101011101101011001001

output:

761231660

result:

ok 1 number(s): "761231660"

Test #251:

score: 0
Accepted
time: 97ms
memory: 10528kb

input:

113 80 55
1011101100000011101100101001101010001101101110100100000

output:

709800363

result:

ok 1 number(s): "709800363"

Test #252:

score: 0
Accepted
time: 56ms
memory: 10556kb

input:

112 60 4
0100

output:

102182244

result:

ok 1 number(s): "102182244"

Test #253:

score: 0
Accepted
time: 60ms
memory: 10580kb

input:

112 64 60
111001100010111110010001001001101011010000000000011101100101

output:

389517980

result:

ok 1 number(s): "389517980"

Test #254:

score: 0
Accepted
time: 68ms
memory: 10524kb

input:

112 68 21
101100100011011011001

output:

272277470

result:

ok 1 number(s): "272277470"

Test #255:

score: 0
Accepted
time: 83ms
memory: 10492kb

input:

112 72 41
00011111100010110001011011100100000111101

output:

894350347

result:

ok 1 number(s): "894350347"

Test #256:

score: 0
Accepted
time: 92ms
memory: 10512kb

input:

112 76 40
0011110010100001001111010111100001000110

output:

846370835

result:

ok 1 number(s): "846370835"

Test #257:

score: 0
Accepted
time: 94ms
memory: 10524kb

input:

112 80 37
0111010111101000101010011110010011000

output:

454801679

result:

ok 1 number(s): "454801679"

Test #258:

score: 0
Accepted
time: 443ms
memory: 10524kb

input:

114 24 1
1

output:

235584783

result:

ok 1 number(s): "235584783"

Test #259:

score: 0
Accepted
time: 458ms
memory: 10512kb

input:

114 24 2
10

output:

937400515

result:

ok 1 number(s): "937400515"

Test #260:

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

input:

114 26 1
0

output:

769149857

result:

ok 1 number(s): "769149857"

Test #261:

score: 0
Accepted
time: 388ms
memory: 10580kb

input:

114 26 2
10

output:

993882655

result:

ok 1 number(s): "993882655"

Test #262:

score: 0
Accepted
time: 175ms
memory: 10552kb

input:

114 28 1
1

output:

997887475

result:

ok 1 number(s): "997887475"

Test #263:

score: 0
Accepted
time: 176ms
memory: 10604kb

input:

114 28 2
01

output:

818090523

result:

ok 1 number(s): "818090523"

Test #264:

score: 0
Accepted
time: 126ms
memory: 10576kb

input:

114 100 32
10001111101000001110000011100010

output:

706009300

result:

ok 1 number(s): "706009300"

Test #265:

score: 0
Accepted
time: 138ms
memory: 10520kb

input:

114 102 45
010000111010011010010101011000100110001100010

output:

483305367

result:

ok 1 number(s): "483305367"

Test #266:

score: 0
Accepted
time: 142ms
memory: 10444kb

input:

114 104 47
01110110010100000010000100010110110011101001100

output:

20070643

result:

ok 1 number(s): "20070643"

Test #267:

score: 0
Accepted
time: 140ms
memory: 10604kb

input:

114 106 48
100010111000111001110110111111001111101110010100

output:

63716393

result:

ok 1 number(s): "63716393"

Test #268:

score: 0
Accepted
time: 144ms
memory: 10560kb

input:

114 108 53
01000010100111100011110011100101000110010011011001010

output:

313529230

result:

ok 1 number(s): "313529230"

Test #269:

score: 0
Accepted
time: 154ms
memory: 10504kb

input:

114 110 42
001101101000011010110011011101100000000010

output:

427932564

result:

ok 1 number(s): "427932564"

Test #270:

score: 0
Accepted
time: 155ms
memory: 10504kb

input:

114 112 63
110110001100011011101100101011110110001101001111010110011011111

output:

34642216

result:

ok 1 number(s): "34642216"

Test #271:

score: 0
Accepted
time: 63ms
memory: 10504kb

input:

114 114 81
101111111100011111001011101000100001111000010000010010100010111101001111001010010

output:

435421011

result:

ok 1 number(s): "435421011"

Test #272:

score: 0
Accepted
time: 132ms
memory: 10504kb

input:

113 100 84
101111100101110101110010000001101111011110110101011110010011011101111101011111110110

output:

536716817

result:

ok 1 number(s): "536716817"

Test #273:

score: 0
Accepted
time: 137ms
memory: 10516kb

input:

113 102 48
011010010101000111100111011000011011100011100110

output:

369768836

result:

ok 1 number(s): "369768836"

Test #274:

score: 0
Accepted
time: 134ms
memory: 10512kb

input:

113 104 34
0110001011010011001110101000000110

output:

260380682

result:

ok 1 number(s): "260380682"

Test #275:

score: 0
Accepted
time: 131ms
memory: 10508kb

input:

113 106 7
0000110

output:

25054400

result:

ok 1 number(s): "25054400"

Test #276:

score: 0
Accepted
time: 145ms
memory: 10600kb

input:

113 108 102
011001001100111000010001011110101001000010010010101111011101000100100001010101101111000111010111110101

output:

792

result:

ok 1 number(s): "792"

Test #277:

score: 0
Accepted
time: 145ms
memory: 10532kb

input:

113 110 95
11110001101111000101110111001011000111010110110000010011100101010010100100010111110100100101010

output:

146314

result:

ok 1 number(s): "146314"

Test #278:

score: 0
Accepted
time: 149ms
memory: 10516kb

input:

113 112 81
100001110011101111100101010100110001101010110000110001110101110101111000111111010

output:

989769082

result:

ok 1 number(s): "989769082"

Test #279:

score: 0
Accepted
time: 130ms
memory: 10556kb

input:

112 100 99
000111001001010010110100010101110011000010111101110001001011000011100111001010100101010000101000110

output:

7576

result:

ok 1 number(s): "7576"

Test #280:

score: 0
Accepted
time: 129ms
memory: 10504kb

input:

112 102 79
1001110111110001111100010001110100000110111110111100111000111000110000110111101

output:

323089977

result:

ok 1 number(s): "323089977"

Test #281:

score: 0
Accepted
time: 128ms
memory: 10564kb

input:

112 104 23
01100001001001000010011

output:

977863866

result:

ok 1 number(s): "977863866"

Test #282:

score: 0
Accepted
time: 130ms
memory: 10500kb

input:

112 106 15
011110111111010

output:

535566837

result:

ok 1 number(s): "535566837"

Test #283:

score: 0
Accepted
time: 132ms
memory: 10556kb

input:

112 108 14
00010001101010

output:

93319069

result:

ok 1 number(s): "93319069"

Test #284:

score: 0
Accepted
time: 138ms
memory: 10560kb

input:

112 110 3
101

output:

778936890

result:

ok 1 number(s): "778936890"

Test #285:

score: 0
Accepted
time: 59ms
memory: 10596kb

input:

112 112 39
001100010001110110011111100011100001111

output:

468353857

result:

ok 1 number(s): "468353857"

Extra Test:

score: 0
Extra Test Passed