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 all(x) (x).begin(), (x).end()
#define itn int
#define make_unique(x) sort((x).begin(), (x).end()); (x).erase(unique((x).begin(), (x).end()), (x).end())

using namespace std;

inline int nxt() {
	int x;
	scanf("%d", &x);
	return x;
}

const int N = 303;
const int mod = 998244353;

int dp[N][N][N];

void add(int& x, int y) {
	x += y;
	if (x >= mod) {
		x -= mod;
	}
}

int main() {
	string s;
	cin >> s;
	int k = nxt();
	int n = s.length();

	s += '0';
	vector<int> cnts;
	for (int i = 0, c = 0; i < n + 1; ++i) {
		if (s[i] == '1') {
			++c;
		} else {
			cnts.push_back(c);
			c = 0;
		}
	}

	const int total = accumulate(all(cnts), 0);
	reverse(all(cnts));

	dp[0][0][0] = 1;
	for (int i = 0; i < (int)cnts.size(); ++i) {
		for (int bal = 0; bal <= total; ++bal) {
			for (int used = 0; used <= total; ++used) {
				if (!dp[i][bal][used]) {
					continue;
				}
				for (int here = 0; here <= total; ++here) {
					if (bal + cnts[i] - here < 0) {
						break;
					}
					add(dp[i + 1][bal + cnts[i] - here][used + max(0, here - cnts[i])], dp[i][bal][used]);
				}
			}
		}
	}

	int ans = 0;
	for (int i = 0; i <= min(k, total); ++i) {
		add(ans, dp[(int)cnts.size()][0][i]);
	}
	cout << ans << "\n";

	return 0;
}