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>
#define F first
#define S second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
const int maxn=305;
const int M=998244353;
int _,ans,dp[maxn][maxn],n,T,a[maxn],m,sum[maxn],S,s1[maxn][maxn],s2[maxn*2][maxn];
char s[maxn];
void add(int &x,int y){
    x+=y; if(x>=M) x-=M;
}
void precalc(){
    memset(s1,0,sizeof(s1));
    memset(s2,0,sizeof(s2));
    for (int j=0;j<=T;j++)
    for (int k=0;k<=S;k++)
        s1[j][k]=s2[j+k][k]=dp[j][k];
    for (int k=1;k<=S;k++)
    for (int j=0;j<=T;j++) add(s1[j][k],s1[j][k-1]);
    for (int j=0;j<=S+T;j++)
    for (int k=1;k<=S;k++) add(s2[j][k],s2[j][k-1]);
}
int main(){
    cin >> s >> T; n=strlen(s);
    m=1;
    for (int i=0;i<n;i++) {
        if (s[i]=='1') a[m]++; else m++;
    }
    //for (int i=1;i<=m;i++)cout<<a[i]<<' ';cout<<endl;
    dp[0][0]=1;
    for (int i=1;i<=m;i++) sum[i]=sum[i-1]+a[i]; S=sum[m]; T=min(S,T);
    //cout<<S<<' '<<T<<endl;
    for (int i=1;i<=m;i++){
        precalc();
        memset(dp,0,sizeof(dp));
        for (int j=0;j<=T;j++)
        for (int k=sum[i];k<=S;k++){
            dp[j][k]=s1[j][k-a[i]];
            add(dp[j][k],s2[j+k-a[i]][k]);
            add(dp[j][k],M-s2[j+k-a[i]][k-a[i]]);
        }
    }
    for (int j=0;j<=T;j++) add(ans,dp[j][S]);
    printf("%d\n",ans);
    return 0;
}