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<iostream>
#include<cstring>
#define mod 998244353
using namespace std;
int n, i, j, ii, k, t, nr, m, sol, jj, x;
char s[305];
int d[305][305][305];
void adauga(int &x, int y){
    x += y;
    if(x >= mod){
        x -= mod;
    }
}
int main(){
    cin>> s + 1;
    cin>> k;
    n = strlen(s + 1);
    s[++n] = '0';
    d[0][0][0] = 1;
    for(i = 1; i <= n; i++){
        if(s[i] == '1'){
            m++;
        }
    }
    for(i = 1; i <= n + 1; i++){
        if(s[i] == '1'){
            nr++;
            continue;
        }
        t++;
        for(j = 0; j <= m; j++){
            for(ii = 0; ii <= m; ii++){
                for(jj = 0; jj <= m; jj++){
                    if(jj >= nr){
                        x = jj - nr;
                        if(j + x <= m && ii + x <= m){
                            adauga(d[t][j + x][ii + x], d[t - 1][j][ii]);
                        }
                    }
                    else{
                        if(nr - jj <= j){
                            x = nr - jj;
                            adauga(d[t][j - x][ii], d[t - 1][j][ii]);
                        }
                    }
                }
            }
        }
        nr = 0;
    }
    for(i = 0; i <= min(m, k); i++){
        adauga(sol, d[t][0][i]);
    }
    cout<< sol;
}