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 <bits/stdc++.h>

using namespace std;

const int N = 303;
const int md = 998244353;

int add(int x, int y) {
  x += y;
  if (x > md) {
    x -= md;
  }
  if (x < 0) {
    x += md;
  }
  return x;
}

int dp[N][N][N];
int pref1[N][N];
int pref2[N][N];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  int n, k;
  cin >> k;
  n = s.size();
  k = min(n, k);
  vector<int> x;
  for (int i = 0; i < n; i++) {
    int cnt = 0;
    while (i < n && s[i] == '1') {
      ++cnt;
      ++i;
    }
    x.push_back(cnt);
  }
  int r = x.size();
  for (int i = 0; i <= k; i++) {
    dp[0][0][i] = 1;
  }
  for (int i = 0; i < r; i++) {
    for (int s = 0; s <= n; s++) {
      pref1[s][0] = dp[i][0][s];
      pref2[s][0] = dp[i][0][s];
    }
    for (int s = 0; s <= n; s++) {
      for (int j = 1; j + s <= n; j++) {
        pref1[s][j] = add(pref1[s][j - 1], dp[i][j][j + s]);
      }
      for (int j = 1; j <= n; j++) {
        pref2[s][j] = add(pref2[s][j - 1], dp[i][j][s]);
      }
    }
    for (int j = 0; j <= n; j++) {
      for (int k = j; k <= n; k++) {
        dp[i + 1][j][k] = add(pref2[k][j], pref1[k - j][j + x[i]] - pref1[k - j][j]);
      }
    }
  }
  cout << dp[r][0][0] << '\n';
  return 0;
}