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 debug(x) cerr << #x << " " << (x) << endl
using namespace std;

const int N = 305;
const long long mod = 998244353ll;

int n, K, num[N], pre[N], cnt = 0;
char str[N];
long long f[N][N << 1], g[N][N << 1], tmp[N][N << 1];

int main () {
	scanf("%s%d", str, &K), n = strlen(str);
	int pos = -1;
	for (int i = 0; str[i]; i++) {
		if (str[i] == '0') {
			num[++cnt] = i - pos - 1;
			pos = i;
		}
	}
	num[++cnt] = n - 1 - pos;
	pre[0] = 0;
	for (int i = 1; i <= cnt; i++) pre[i] = pre[i - 1] + num[i];

	for (int i = 0; i <= pre[cnt]; i++) {
		for (int j = 0; j <= (pre[cnt] << 1); j++) f[i][j] = 0ll;
	}
	f[0][0] = 1ll;
	for (int i = 1; i <= cnt; i++) {
		for (int j = 0; j <= (pre[cnt] << 1); j++) {
			tmp[0][j] = f[0][j];
			for (int k = 1; k <= pre[cnt]; k++) tmp[k][j] = (tmp[k - 1][j] + f[k][j]) % mod;
		}
		for (int j = 0; j <= pre[cnt]; j++) {
			for (int k = 0; k <= (pre[cnt] << 1); k++) {
				g[j][k] = 0ll;
				if (j >= pre[i]) {
					g[j][k] = j > num[i] ? tmp[j - num[i] - 1][k] : 0ll;
					for (int l = 0; l <= min(num[i], j); l++) {
						if (k + l >= num[i]) g[j][k] = (g[j][k] + f[j - l][k + l - num[i]]) % mod;
					}
				}
			}
		}
		for (int j = 0; j <= pre[cnt]; j++) {
			for (int k = 0; k <= (pre[cnt] << 1); k++) f[j][k] = g[j][k];
		}
	}

	long long ans = 0ll;
	for (int i = 0; i <= min(pre[cnt] << 1, K); i++) ans = (ans + f[pre[cnt]][i]) % mod;
	printf("%lld\n", ans);
	return 0;
}