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 Mod = 998244353;
int main() {
    string s;
    int K;
    cin >> s >> K;
    vector<int> groups(1);
    int n_ones = 0;
    for (char c: s) {
        if (c == '1') {
            ++groups.back();
            ++n_ones;
        }
        else {
            groups.push_back(0);
        }
    }
    vector<vector<vector<int>>> dp(groups.size() + 1,
                vector<vector<int>>(n_ones + 1, vector<int>(n_ones + 1)));
    dp[0][0][0] = 1;
    int sum = 0;
    for (int k = 1; k <= (int) groups.size(); ++k) {
        sum += groups[k - 1];
        for (int g = 0; g <= n_ones; ++g) {
            for (int si = sum; si <= n_ones; ++si) {
                for (int sp = 0; sp <= n_ones; ++sp) {
                    int psi = si - g;
                    int psp = sp - max(g - groups[k - 1], 0);
                    if (psi < 0 || psp < 0)
                        continue;
                    dp[k][si][sp] = (dp[k][si][sp] + dp[k - 1][psi][psp]) % Mod;
                }
            }
        }
    }
    int res = 0;
    for (int i = 0; i <= n_ones; ++i) {
        for (int k = 0; k <= min(K, n_ones); ++k)
            res = (res + dp.back()[i][k]) % Mod;
    }
    cout << res << "\n";
    return 0;
}