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;
//mt19937 mrand(chrono::high_resolution_clock::now().time_since_epoch().count());
//int rnd(int x) { return mrand()%x;}
typedef long long ll;
ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
char s[500];
ll dp[500][500][500];
ll k;
vector<ll> v;
ll suf[400];
int len;
const ll md=998244353;
ll dfs(ll pos,ll lim,ll res){
	if(pos==len){
		if(lim==0) return 1;
		else return 0;
	}
	if(dp[pos][lim][res]!=-1) return dp[pos][lim][res];
	ll ret=0;
	for(int i=max(v[pos]-lim,0ll);i-v[pos]+lim<=suf[pos] && i-v[pos]<=res;i++){
		ret=(ret+dfs(pos+1,lim+i-v[pos],res-max(0ll,i-v[pos])))%md;
	}
	dp[pos][lim][res]=ret;
	return ret;
}
int main(){
	memset(dp,-1,sizeof(dp));
	scanf("%s%lld",s+1,&k);
	k=min(k,300ll);
	ll cnt=0;
	for(int i=1;s[i];i++){
		if(s[i]=='0'){
			v.push_back(cnt);
			cnt=0;	
		}
		else{
			cnt++;
		}
	}
	v.push_back(cnt);
	len=(int)v.size();
	suf[len]=0;
	for(int i=len-1;i>=0;i--){
		suf[i]=suf[i+1]+v[i];
	}
	ll ans=dfs(0,0,min(k,300ll));
	printf("%lld\n",ans);
	return 0;
}