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 endl '\n'

#define SZ(x) ((int)x.size())
#define ALL(V) V.begin(), V.end()
#define L_B lower_bound
#define U_B upper_bound
#define pb push_back

using namespace std;
template<class T, class T1> int chkmin(T &x, const T1 &y) { return x > y ? x = y, 1 : 0; }
template<class T, class T1> int chkmax(T &x, const T1 &y) { return x < y ? x = y, 1 : 0; }
const int MAXN = 342;
const int mod = 998244353;

string s;
int n;
int k;

void read() {
	cin >> s >> k;
	n = SZ(s);
	chkmin(k, n);
}

int dp[MAXN][MAXN][MAXN];

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

void solve() {
	vector<int> pos0;
	pos0.pb(-1);
	for(int i = 0; i < n; i++) {
		if(s[i] == '0') pos0.pb(i);
	}

	pos0.pb(n);

	dp[0][0][0] = 1;

	int m = SZ(pos0) - 1, z = n + 1 - m;
	for(int i = 1; i <= m; i++) {
		int actual_cnt_1 = pos0[i] - pos0[i - 1] - 1;
		for(int q = 0; q <= k; q++) {
			for(int bal = 0; bal <= z; bal++) {
				if(dp[i - 1][bal][q]) {
					for(int c = 0; c <= z; c++) {
						int delta = c - actual_cnt_1;
						int new_q = q + max(delta, 0);
						if(new_q <= k && delta + bal >= 0) {
							add(dp[i][delta + bal][new_q], 
							    dp[i - 1][bal][q]);
						}
					}
				}
			}
		}
	}

	int ans = 0;
	for(int i = 0; i <= k; i++) {
		add(ans, dp[m][0][i]);
	}
	
	cout << ans << endl;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	read();
	solve();
	return 0;
}