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;

typedef long long ll;
const int maxn=1e6+7;
const int inf=INT_MAX;
const ll inff=1e18;
const int mod=998244353;
#define pii pair<int,int>
#define mkp make_pair
#define F first
#define S second
#define pb push_back
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(),(v).end()
//#define int ll

#ifdef HNO2
#define IOS
#else
#define endl '\n'
#define IOS ios::sync_with_stdio(0); cin.tie(0);
#endif // HNO2

int dp[2][307][307];
vector<int> v;

inline int singlemod(int x)
{
    return x>=mod ? x-mod : x;
}

int32_t main()
{
    IOS
    string s;
    int n,K;
    cin>>s>>K;
    n=s.length();
    K=min(n,K);

    int summ=0;
    v.pb(0);
    for (int i=0;i<n;i++)
        if (s[i]=='0') v.pb(summ);
        else summ++;
    int _0=sz(v)-1;
    K=min(K,n-_0);

    dp[0][0][0]=1;

    for (int i=1;i<=_0;i++)
    {
        //clear
        memset(dp[i&1],0,sizeof(dp[i&1]));

        for (int j=0;j<=(n-_0)-v[i];j++)
            for (int k=0;k<=n-_0;k++)
        {
            for (int l=0;l<=j;l++) dp[i&1][j][k]=singlemod(dp[i&1][j][k]+dp[i&1^1][l][k]);
            for (int l=j+1;l<=min({j+(v[i]-v[i-1]),n-_0,k+j});l++)
                dp[i&1][j][k]=singlemod(dp[i&1][j][k]+dp[i&1^1][l][k-(l-j)]);
        }
    }
    //

    int ans=0;
    for (int i=0;i<=(n-_0);i++)
        for (int j=0;j<=K;j++)
            if (i+j<=K) ans=(ans+dp[_0&1][i][j])%mod;
    cout<<ans<<endl;
}