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 <cassert>
#include <numeric>
#include <cstring>
#include <iostream>

using namespace std;
const int M = 998244353;
int main() {
    string s; int K; cin >> s >> K;
    size_t p = s.find('0');
    if (p == string::npos) { cout << "1\n"; return 0; }
    else s = s.substr(p);
    int n = s.size();
    K = min(K, n);
    long long dp[2][n+1][K+1];
    memset(dp, 0, sizeof dp);
    int cur = 0, prev = 1;
    for (int j = 0; j <= K; j++) {
        if (j <= K) dp[prev][j][j] = 1;
    }

    int i0 = 0;
    for (;;) {
        int i = i0+1;
        while (i < n && s[i] == '1') i++;
        if (i == n) break;
        for (int j = i; j <= n; j++) {
            for (int k = 0; k <= K; k++) {
                long long sum = 0;
                for (int j1 = max(i0, j - (i - i0) - k); j1 < j; j1++) {
                    int k1 = j - j1 - (i - i0);
                    assert (k >= max(0, k1));
                    sum += dp[prev][j1][k - max(0, k1)];
                }
                dp[cur][j][k] = (sum % M + M) % M;
            }
        }
        i0 = i;
        swap(prev, cur);
    }
    long long ans = accumulate(dp[prev][i0], dp[prev][n], 0LL);
    cout << (ans % M + M) % M << endl;
}