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:
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const int mod=998244353,N=305;
int nm,m,n,f[N][N][N],ans,sum[N],a[N],sum1[N][N][N],sum2[N][N][N];
char s[N];

signed main(){
	scanf("%s",s+1);read(m);
	n=strlen(s+1);s[++n]='0';
	for(int i=1;i<=n;i++){
		if(s[i]=='0') nm++;
		else a[nm+1]++;
	}
	for(int i=1;i<=nm;i++) sum[i]=sum[i-1]+a[i];
	m=min(m,sum[nm]);
	f[0][0][0]=1;
	for(int i=0;i<=nm;i++) 	for(int j=sum[i];j<=sum[nm];j++){
		int lim=min(j,sum[nm]-sum[i-1]);
		if(i) for(int k=0;k<=m;k++){
			int tp1=min({a[i],lim,j}),tp2=min({lim,a[i]+k,j});
			f[i][j][k]=(sum1[i-1][j][k]-(j>=tp1+1?sum1[i-1][j-tp1-1][k]:0)+mod)%mod;
			if(tp2>=a[i]+1) f[i][j][k]=((f[i][j][k]+(j>=a[i]+1&&k?sum2[i-1][j-a[i]-1][k-1]:0))%mod-(j>=tp2+1&&k>=tp2+1-a[i]?sum2[i-1][j-tp2-1][k-tp2-1+a[i]]:0)+mod)%mod;
		} 
		for(int k=0;k<=m;k++){
			sum1[i][j][k]=j?(sum1[i][j-1][k]+f[i][j][k])%mod:f[i][j][k];
			sum2[i][j][k]=j&&k?(sum2[i][j-1][k-1]+f[i][j][k])%mod:f[i][j][k];	
		}
	}
	for(int i=0;i<=m;i++) ans=(ans+f[nm][sum[nm]][i])%mod;
	write(ans);
}