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>

typedef long long LL;
const int Mod = 998244353;
const int MN = 305;

inline void Sub(int &x, int y) { x -= y; x += x >> 31 & Mod; }
inline void Add(int &x, int y) { Sub(x, Mod - y); }

char s[MN];
int N, K, A[MN];
int M, C[MN];
int f[2][MN][MN], tmp[MN][MN];

int main() {
	scanf("%s%d", s + 1, &K), N = strlen(s + 1);
	for (int i = 1; i <= N; ++i) A[i] = s[i] - '0';
	A[N + 1] = 0;
	for (int i = 1, c = 0; i <= N + 1; ++i)
		if (A[i]) ++c;
		else C[++M] = c, c = 0;
	int o = 0;
	f[o][0][0] = 1;
	for (int i = 1; i <= M; ++i) {
		o ^= 1;
		for (int j = 0; j <= N; ++j)
			for (int k = 0; k <= N; ++k)
				f[o][j][k] = tmp[j][k] = 0;
		for (int j = 0; j <= N; ++j)
			for (int k = 0; k <= N; ++k) if (f[o ^ 1][j][k]) {
				int val = f[o ^ 1][j][k];
				f[o][j][k] = val;
				Add(tmp[std::max(0, j - C[i])][k], val);
				Sub(tmp[j][k], val);
			}
		for (int j = 1; j <= N; ++j)
			for (int k = 0; k <= N; ++k) {
				if (k) Add(f[o][j][k], f[o][j - 1][k - 1]);
				Add(tmp[j][k], tmp[j - 1][k]);
			}
		for (int j = 0; j <= N; ++j)
			for (int k = 0; k <= N; ++k)
				Add(f[o][j][k], tmp[j][k]);
	}
	K = std::min(K, N);
	int Ans = 0;
	for (int k = 0; k <= K; ++k) Add(Ans, f[o][0][k]);
	printf("%d\n", Ans);
	return 0;
}