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 <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

const int MAXN = 300;
const int MOD = 998244353;

inline int add(int x, int y) {x += y; return x >= MOD ? x - MOD : x;}
inline int sub(int x, int y) {x -= y; return x < 0 ? x + MOD : x;}
inline int mul(int x, int y) {return (int)(1LL * x * y % MOD);}

int pow_mod(int b, int p) {
	int ret = 1;
	for(int i=p;i;i>>=1,b=mul(b,b))
		if( i & 1 ) ret = mul(ret, b);
	return ret;
}

int a[MAXN + 5], s, m, K;
int dp[2][MAXN + 5][MAXN + 5];
int solve() {
	int t = 0; dp[0][0][0] = 1;
	for(int i=m;i>=1;i--) {
		for(int k=0;k<=t;k++)
			for(int j=0;j<=t;j++)
				dp[1][k][j] = dp[0][k][j], dp[0][k][j] = 0;
		
		for(int k=0;k<=t;k++) {
			dp[0][k][t] = dp[1][k][t];
			for(int j=t-1;j>=0;j--)
				dp[0][k][j] = add(dp[0][k][j + 1], dp[1][k][j]);
		}
		
		for(int k=0;k<=t;k++)
			for(int j=0;j<=t;j++)
				for(int l=1;l<=a[i];l++)
					dp[0][k+l][j+l] = add(dp[0][k+l][j+l], dp[1][k][j]);
		
		t += a[i];
	}
	
	int lim = min(K, s), ans = 0;
	for(int i=0;i<=lim;i++)
		ans = add(ans, dp[0][i][0]);
	return ans;
}

char S[MAXN + 5]; int n;
int main() {
	scanf("%s%d", S, &K), n = strlen(S);
	
	int cnt = 0;
	for(int i=0;i<n;i++) {
		if( S[i] == '0' )
			a[++m] = cnt, cnt = 0;
		else cnt++, s++;
	}
	a[++m] = cnt, printf("%d\n", solve());
}