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>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

const int N = 310, mod = 998244353;
int n,k,dp[N][2*N][N],cnt,p[N],a[N];
char s[N];

inline void upd(int &x,int y){
	x+=y;
	if (x>=mod) x-=mod;
}

int main(){
	scanf("%s%d",s+1,&k),n=strlen(s+1);
	For(i,1,n) if (s[i]=='0') p[++cnt]=i;
	For(i,1,cnt) a[i]=p[i]-p[i-1]-1;
	a[cnt+1]=n-p[cnt],k=min(k,(n-cnt));
	dp[0][0][0]=1;
	For(i,0,cnt-1) For(j,0,n-cnt) For(l,0,k) if (dp[i][j][l]){
		For(p,0,n-cnt) if (j+p-a[i+1]>=0) upd(dp[i+1][j+p-a[i+1]][l+max(0,a[i+1]-p)],dp[i][j][l]); 
	}
	int ans=0; 
	For(i,0,a[cnt+1]) For(j,0,k-i) upd(ans,dp[cnt][i][j]);
	printf("%d\n",ans);
}