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 ll long long
using namespace std;
const ll N=3e2+5;
const ll p=998244353;

ll read()
{
	ll s=0;
	char c=getchar(),lc='+';
	while (c<'0'||'9'<c) lc=c,c=getchar();
	while ('0'<=c&&c<='9') s=s*10+c-'0',c=getchar();
	return lc=='-'?-s:s;
}
void write(ll x)
{
	if (x<0)
	{
		putchar('-');
		x=-x;
	}
	if (x<10) putchar(x+'0');
	else
	{
		write(x/10);
		putchar(x%10+'0');
	}
}
void print(ll x,char c='\n')
{
	write(x);
	putchar(c);
}
ll dp[N][N][N],a[N],sum[N];
char s[N];

int main()
{
	
	memset(dp,0,sizeof(dp));
	memset(sum,0,sizeof(sum));
	scanf("%s",s+1);
	ll n=strlen(s+1),m=min(n,read()),cnt=1;
	for (ll i=1;i<=n;i++)
	if (s[i]=='1') a[cnt]++;
			  else cnt++;
	sum[0]=0;
	for (ll i=1;i<=cnt;i++) sum[i]=sum[i-1]+a[i];
	dp[0][0][0]=1;
	for (ll i=1;i<=cnt;i++)//前i个 
	for (ll j=sum[i];j<=sum[cnt];j++)//和为j 
	for (ll k=0;k<=m;k++)//共操作k次 
	for (ll l=0;l<=j;l++)//第i位填l 
	if (k>=max(l-a[i],0ll)) dp[i][j][k]=(dp[i][j][k]+dp[i-1][j-l][k-max(l-a[i],0ll)])%p;
	ll ans=0;
	for (ll i=0;i<=m;i++) ans=(ans+dp[cnt][sum[cnt]][i])%p;
	print(ans);

	return 0;
}