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 <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using namespace std;

const int M=998244353;

const int MAXL=600;
char str[305];
int f[305][305][605],g[305],sg[305],k,n,ans;

int main () {
	
	scanf ("%s%d",str,&k);
	for (int i=0,ii=strlen (str);i<ii;i++) {
		if (str[i]=='0') n++;
		else g[n]++;
	}
	for (int i=n;i>=0;i--) {
		sg[i]=sg[i+1]+g[i];
	}
	if (n==0) {puts ("1"); return 0;}
	for (int j=0;j<=g[n];j++) f[n][j][0]=1;
	for (int i=n-1;i>0;i--) {
		for (int j=0;j<=sg[i];j++) {
			for (int k=0;k<=j&&k<=g[i];k++) {
				for (int l=0;l<=sg[i];l++) {
					f[i][j][l]+=f[i+1][j-k][l];
					if (f[i][j][l]>=M) f[i][j][l]-=M;
				}
			}
			for (int k=g[i]+1;k<=j;k++) {
				for (int l=0;l<=sg[i]&&l<=MAXL;l++) {
					f[i][j][l+k-g[i]]+=f[i+1][j-k][l];
					if (f[i][j][l+k-g[i]]>=M) f[i][j][l+k-g[i]]-=M;
				}
			}
		}
	}
	for (int j=0;j<=sg[1];j++) {
		for (int l=0;l<=MAXL;l++) {
			int p=l+sg[1]-j;
			if (p>k) break;
			ans+=f[1][j][l];
			if (ans>=M) ans-=M;
		}
	}
	printf ("%d\n",ans);
	
	return 0;
}