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<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define mod 998244353
#define pl(a,b) a=(a+b)%mod;
#define N 350
ll dp[N][N][N];
int main(){
	string S;
	ll K;
	cin>>S>>K;
	ll n=0,a[N];
	ll cnt=0;
	rep(i,S.size()){
		if(S[i]=='0'){
			a[++n]=cnt;
			cnt=0;
		}
		else{
			cnt++;
		}
	}
	a[++n]=cnt;
	chmin(K,(ll)310);
	rep(i,N)rep(j,N)rep(k,N)dp[i][j][k]=0;
	dp[0][0][0]=1;
	for(ll i=1;i<=n;i++){
		ll cs1[N][N],cs2[N][N];
		rep(j,N)for(ll k=0;k<=K;k++){
			if(j-1>=0&&k-1>=0){
				cs1[j][k]=cs1[j-1][k-1];
			}
			else{
				cs1[j][k]=0;
			}
			pl(cs1[j][k],dp[i-1][j][k]);
			pl(dp[i][j][k],cs1[j][k]);
			/*for(ll s=0;j-s>=0&&k-s>=0;s++){
				pl(dp[i][j][k],dp[i-1][j-s][k-s]);
			}*/
		}
		for(ll j=N-1;j>=0;j--)for(ll k=0;k<=K;k++){
			if(j+2<N){
				cs2[j][k]=cs2[j+1][k];
			}
			else{
				cs2[j][k]=0;
			}
			pl(cs2[j][k],dp[i-1][j][k]);
			pl(dp[i][j][k],cs2[j+1][k]);
			if(j+a[i]+1<N){
				pl(dp[i][j][k],-cs2[j+a[i]+1][k]);
			}
			/*for(ll t=1;t<=a[i]&&j+t<N;t++){
				pl(dp[i][j][k],dp[i-1][j+t][k]);
			}*/
		}
	}
	ll ans=0;
	for(ll k=0;k<=K;k++){
		pl(ans,dp[n][0][k]);
	}
	if(ans<0)ans+=mod;
	cout<<ans<<endl;
}