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;
typedef long long ll;
const ll mod=998244353;
const int N=305;
int n;
ll z;
string s;
ll f[N];
ll dp[N][N];
ll pf[N][N];
ll pf2[N][N];
void buildpf(){
	for(int j=0; j<=n ;j++){
		for(int k=0; k<=n ;k++){
			pf[j][k]=pf2[j][k]=dp[j][k];
			if(j>0) pf[j][k]=(pf[j][k]+pf[j-1][k])%mod;
			if(j>0 && k>0) pf2[j][k]=(pf2[j][k]+pf2[j-1][k-1])%mod;
		}
	}
}
int main(){
	ios::sync_with_stdio(false);
	int c=0;
	cin >> s;n=s.size();s='?'+s;
	cin >> z;
	for(int i=1; i<=n ;i++){
		if(s[i]=='0') c++;
		else f[c]++;
	}
	dp[0][0]=1;
	buildpf();
	int sum=0;
	for(int i=0; i<=c ;i++){
		sum+=f[i];
		for(int j=n-c; j>=0 ;j--){
			for(int y=0; y<=n ;y++){
				if(j<sum){
					dp[j][y]=0;continue;
				}
				ll res=0;
				res=res+pf2[j-f[i]][y]+pf[j][y]-pf[j-f[i]][y];
				dp[j][y]=(res%mod+mod)%mod;
			}
		}
		buildpf();
	}
	ll ans=0;
	for(int i=0; i<=min((ll)n,z) ;i++) ans=(ans+dp[n-c][i])%mod;
	cout << ans << endl;
}