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>
using namespace std;
const int MOD=998244353;
int n,K;
char s[333];
int f[333][333][333],tx[333][333],ty[333][333];
int cnt[333];
int main()
{
	ios_base::sync_with_stdio(false);
	cin>>(s+1)>>K;
	n=strlen(s+1);if(K>n)K=n;
	int cur=0;
	for(int i=1;i<=n;i++)
	{
		if(s[i]=='0')cur++;
		else cnt[cur]++;
	}
	n=cur;
	f[n+1][0][0]=1;
	for(int i=n;i>=0;i--)
	{
		for(int j=1;j<=K;j++)
		{
			for(int k=1;k<=K;k++)
			{
				tx[j][k]=(tx[j-1][k-1]+f[i+1][j-1][k-1])%MOD;
			}
		}
		for(int j=K;j>=0;j--)
		{
			for(int k=0;k<=K;k++)
			{
				ty[j][k]=(ty[j+1][k]+f[i+1][j][k])%MOD;
			}
		}
		for(int j=0;j<=K;j++)
		{
			for(int k=j;k<=K;k++)
			{
				f[i][j][k]=(0ll+tx[j][k]-((j>=cnt[i])?tx[j-cnt[i]][k-cnt[i]]:0)+ty[j][k]+MOD)%MOD;
//				cerr<<i<<' '<<j<<' '<<k<<' '<<f[i][j][k]<<endl;
//				cerr<<tx[j][k]<<' '<<ty[j][k]<<endl;
			}
		}
	}
	long long ans=0;
	for(int i=0;i<=K;i++)
	{
		ans+=f[0][0][i];
	}
	cout<<ans%MOD<<endl;
	return 0;
}