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 N = 300 + 10, mod = 998244353;
void add(ll &x,ll y){
    (x += y) %= mod;
}
char s[N];
int n,k;
ll f[N][N],s1[N][N],s2[N][N];
void calc(){
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n;j++){
            s1[i][j] = s2[i][j] = f[i][j];
            if(i-1>=0&&j-1>=0) add(s1[i][j],s1[i-1][j-1]);
            if(j-1>=0) add(s2[i][j],s2[i][j-1]);
        }
    }
}
int main(){
    cin>>s>>k;
    n = strlen(s);
    f[0][0] = 1;
    calc();
    for(int i=0,j=0;i<n;i=j=j+1){
        while(s[j]=='1') j++;
        int c = j - i;
        for(int x=0;x<=n;x++){
            for(int y=0;y<=n;y++){
                f[x][y] = 0;
                add(f[x][y],s2[x][min(y+c,n)]-s2[x][y]+mod);
                add(f[x][y],s1[x][y]);
            }
        }
        calc();
    }
    ll ans = 0;
    for(int i=0;i<=min(n,k);i++) add(ans,f[i][0]);
    cout<<ans<<endl;
}