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 Nmax = 305, Mod = 998244353;

int dp[Nmax][Nmax][Nmax];
string s;
int k;
vector<int> all;

void add_to(int &x, int y)
{
    x += y;
    if(x >= Mod) x-=Mod;
}

int main()
{
    //freopen("input", "r", stdin);
    cin.sync_with_stdio(false);
    cin.tie(0);

    cin >> s >> k;

    int nr = 0, ones = 0;
    for(auto it : s)
        if(it == '0') all.push_back(nr), nr = 0;
            else ++nr, ++ones;

    all.push_back(nr);
    k = min(k, ones);

    dp[all.size()][0][0] = 1;

    int sum = 0;
    int i, j, cnt, p;

    for(i = all.size() - 1; i>=0; --i)
    {
        sum += all[i];

        for(j=0; j<=sum; ++j)
            for(cnt=0; cnt<=j; ++cnt)
                for(p=0; p<=k; ++p)
                    add_to(dp[i][j][p], dp[i+1][j-cnt][p -max(0, cnt - all[i])]);
    }

    int ans = 0;
    for(i=0; i<=k; ++i)
        add_to(ans, dp[0][ones][i]);
    cout << ans << '\n';

    return 0;
}