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 <stdio.h>
#include <algorithm>
#include <vector>
using namespace std;

const long long mod = 998244353;
char S[303]; int K; long long D[303][606], P[303][606];

void add(long long& a, long long b)
{
	a += b;
	if (a >= mod)
		a -= mod;
}

int main()
{
	scanf ("%s", S);
	scanf ("%d", &K);

	int cnt = 0;
	vector<int> v;
	for (int i = 0; S[i]; i++){
		if (S[i] == '1') cnt++;
		else{
			v.push_back(cnt);
			cnt = 0;
		}
	}
	v.push_back(cnt);

	D[0][0] = 1;
	int s = 0;
	while (!v.empty()){
		int a = v.back(); v.pop_back(); s += a;
		for (int b = 0; b <= s; b++){
			int m = abs(a - b);
			for (int j = 0; j <= s; j++) if (j + a - b >= 0){
				for (int k = 0; k <= s * 2; k++){
					add(P[j + a - b][k + m], D[j][k]);
				}
			}
		}
		for (int j = 0; j <= s; j++) for (int k = 0; k <= s * 2; k++){
			D[j][k] = P[j][k];
			P[j][k] = 0;
		}
	}

	long long ans = 0;
	for (int k = 0; k <= s * 2; k += 2) if (k / 2 <= K){
		add(ans, D[0][k]);
	}
	printf ("%lld\n", ans);

	return 0;
}