Problem: Given is a string S consisting of `0` and `1`. Find the number of strings, modulo 998244353, that can result from applying the following operation on S between 0 and K times (inclusive):

* Choose a pair of integers i, j (1\leq i < j\leq |S|) such that the i-th and j-th characters of S are `0` and `1`, respectively. Remove the j-th character from S and insert it to the immediate left of the i-th character.

Constraints

* 1 \leq |S| \leq 300
* 0 \leq K \leq 10^9
* S consists of `0` and `1`.

Input

Input is given from Standard Input in the following format:


S K


Output

Find the number of strings, modulo 998244353, that can result from applying the operation on S between 0 and K times (inclusive).

Examples

Input

0101 1


Output

4


Input

01100110 2


Output

14


Input

1101010010101101110111100011011111011000111101110101010010101010101 20


Output

113434815

Solution (in CPP):

Solution:
#include <iostream>
#include <cstring>
#include <cstdio>
#define MN 300
#define mod 998244353
using namespace std;
int n, K, sum[MN * 2 + 5], sum2[MN + 5];
char s[MN + 5];
int f[MN + 5][MN + 5][MN + 5]; // first i bit, use j operations and k '1' from the latter n-i bits
inline void R(int &x, int y) {
  (x += y) >= mod ? x -= mod : 0;
}
inline int IntevalSum2(int l, int r) {
  return (sum2[r] - (l ? sum2[l - 1] : 0) + mod) % mod;
}
int main() {
  scanf("%s%d", s + 1, &K);
  n = strlen(s + 1);
  K = min(n, K);
  f[0][0][0] = 1;
  int i = 0, num = 0;
  for (int pos = 1; pos <= n + 1; ++pos) {
    if (s[pos] == '1') {
      ++num; 
    } else {
      ++i;
      // f[i-1][j][k] -> f[i][j][k - t]   t = 0 - num
      // f[i-1][j][k] -> f[i][j + t][k + t]  t = 1 - inf
      memset(sum, 0 ,sizeof(sum));
      for (int j = 0; j <= K; ++j) {
        sum2[0] = f[i - 1][j][0];
        for (int k = 1; k <= j; ++k) { //prefix sum
          sum2[k] = (sum2[k - 1] + f[i - 1][j][k]) % mod;
        }
        for (int k = 0; k <= j; ++k) {
          f[i][j][k] = (IntevalSum2(k, min(k + num, j)) + sum[j - k + n]) % mod;
          R(sum[j - k + n], f[i - 1][j][k]);
        }
      }
      num = 0;
    }
  }
  int ans = 0;
  for (int k = 0; k <= K; ++k) {
    R(ans, f[i][k][0]);
  }
  printf("%d", ans);
  return 0;
}