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<cstdio>
using namespace std;

const long long mod=998244353;
int K,n;
char s[305];
int a[305];
long long dp[305][305][2],s1[305][305][2],s2[305][305][2];
int main()
{
	int i,j,k,l;
	scanf("%s",s+1);
	scanf("%d",&K);
	K=min(K,300);
	for(i=1,n=1;s[i];i++)
	{
		if(s[i]=='1')
			a[n]++;
		else n++;
	}
	for(i=0;i<=300;i++)
		dp[i][i][1]=1;
	for(j=0;j<=300;j++)
	{
		s1[j][0][1]=dp[j][0][1];
		for(l=1;l<=j;l++)
		{
			s1[j][l][1]=(s1[j-1][l-1][1]+dp[j][l][1])%mod;
		}
	}
	for(j=0;j<=300;j++)
	{
		s2[j][0][1]=dp[j][0][1];
		for(l=1;l<=300;l++)
		{
			s2[j][l][1]=(s2[j][l-1][1]+dp[j][l][1])%mod;
		}
	}
	for(i=2;i<=n;i++)
	{
		int t=i&1;
		for(j=0;j<=300;j++)
			for(l=0;l<=300;l++)
				dp[j][l][t]=0;
		for(j=0;j<=300;j++)
			for(l=0;l<=j;l++)
			{
				dp[j][l][t]=s1[j][l][t^1];
				//for(k=j-l;k<=j;k++)
				//	dp[j][l][t]=(dp[j][l][t]+dp[k][l-j+k][t^1])%mod;
			}
		for(j=0;j<=300;j++)
			for(l=0;l<=min(300-a[i],j);l++)
			{
				dp[j][l][t]=(dp[j][l][t]+s2[j][l+a[i]][t^1]-s2[j][l][t^1]+mod)%mod;
				//for(k=1;k<=a[i];k++)
				//	dp[j][l][t]=(dp[j][l][t]+dp[j][l+k][t^1])%mod;
			}
		for(j=0;j<=300;j++)
		{
			s1[j][0][t]=dp[j][0][t];
			for(l=1;l<=j;l++)
				s1[j][l][t]=(s1[j-1][l-1][t]+dp[j][l][t])%mod;
		}
		for(j=0;j<=300;j++)
		{
			s2[j][0][t]=dp[j][0][t];
			for(l=1;l<=300;l++)
				s2[j][l][t]=(s2[j][l-1][t]+dp[j][l][t])%mod;
		}
	}
	long long ans=0;
	for(i=0;i<=K;i++)
	{
		ans=(ans+dp[i][0][n&1])%mod;
	}
	cout<<ans<<endl;
	return 0;
}