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;

const int MX = 301, md = 998244353;

char str[MX];
int a[MX], s[MX], f[MX][MX], g[MX][2 * MX], h[MX + 1][2 * MX];

int main() {
	int k;
	ignore = scanf("%s %d", str, &k);
	
	k = min(k, MX - 1);
	
	int n = 0;
	for (int i = 0, c = 0; true; i++) {
		if (str[i] == '1') c++;
		else {
			a[n++] = c;
			c = 0;
			
			if (str[i] == 0) break;
		}
	}
	
	s[0] = 0;
	for (int i = 0; i < n; i++) s[i + 1] = s[i] + a[i];
	
	f[0][0] = 1;
	for (int p = 0; p < n; p++) {
		memset(g, 0, sizeof g);
		memset(h, 0, sizeof h);
		
		for (int x = 0; x <= k; x++)
			for (int y = s[p]; y < MX; y++) {
				g[x][y] += f[x][y];
				g[x][y] %= md;
				
				g[x][y + a[p]] += md - f[x][y];
				g[x][y + a[p]] %= md;
				
				h[x][y + a[p]] += f[x][y];
				h[x][y + a[p]] %= md;
			}
		
		for (int x = 0; x < MX; x++)
			for (int y = 0; y < MX; y++) {
				f[x][y] = (g[x][y] + h[x][y]) % md;
				
				g[x][y + 1] += g[x][y];
				g[x][y + 1] %= md;
				
				h[x + 1][y + 1] += h[x][y];
				h[x + 1][y + 1] %= md;
			}
	}
	
	int ans = 0;
	for (int x = 0; x <= k; x++) {
		ans += f[x][s[n]];
		ans %= md;
	}
	
	printf("%d\n", ans);
	
	return 0;
}