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],s1[305][305],s2[305][305];
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;
	for(i=2;i<=n;i++)
	{
		for(j=0;j<=300;j++)
		{
			s1[j][0]=dp[j][0];
			for(l=1;l<=j;l++)
				s1[j][l]=(s1[j-1][l-1]+dp[j][l])%mod;
		}
		for(j=0;j<=300;j++)
		{
			s2[j][0]=dp[j][0];
			for(l=1;l<=300;l++)
				s2[j][l]=(s2[j][l-1]+dp[j][l])%mod;
		}
		for(j=0;j<=300;j++)
			for(l=0;l<=j;l++)
				dp[j][l]=s1[j][l];
		for(j=0;j<=300;j++)
			for(l=0;l<=min(300-a[i],j);l++)
				dp[j][l]=(dp[j][l]+s2[j][l+a[i]]-s2[j][l]+mod)%mod;
	}
	long long ans=0;
	for(i=0;i<=K;i++)
		ans=(ans+dp[i][0])%mod;
	cout<<ans<<endl;
	return 0;
}