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 ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ss(x) (int) x.size()
#define fi first
#define se second
#define cat(x) cerr << #x << " = " << x << endl
#define rep(i, j, n) for (int i = j; i <= n; ++i)
#define per(i, j, n) for (int i = n; j <= i; --i)
#define all(x) x.begin(), x.end()
 
using namespace std;

const int N = 310;
const int MOD = 998244353;

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

char s[N];
int n, k;
vector <int> v;

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

int main() {
	scanf ("%s%d", s + 1, &k);
	n = strlen(s + 1);
	k = min(k, n);
	int ones = 0;
	rep(i, 1, n) {
		if (s[i] == '1') ones++;
		if (s[i] == '0') {
			v.pb(ones);
			ones = 0;
		}
	}
	v.pb(ones);
	dp[0][0][0] = 1;
	rep(j, 0, k)
		rep(g, 0, k) {
			dp2[0][j][g] = dp[0][j][g];
			if (j && g) add(dp2[0][j][g], dp2[0][j - 1][g - 1]);
		}
	
	int M = ss(v);
	rep(i, 1, M) {
		ones = v[i - 1];
		rep(j, 0, k) {
			rep(g, 0, k) {
				rep(pomoc, 0, ones) {
					if (g + pomoc > k) continue;
					add(dp[i][j][g], dp[i - 1][j][g + pomoc]);
				}
				if (j >= 1 && g >= 1) {
					add(dp[i][j][g], dp2[i - 1][j - 1][g - 1]);
				}
				add(dp2[i][j][g], dp[i][j][g]);
				if (j && g)
					add(dp2[i][j][g], dp2[i][j - 1][g - 1]);
				//printf ("%d %d %d %d\n", i, j, g, dp[i][j][g]);
			}
		}	
	}
	int ans = 0;
	rep(i, 0, k)
		add(ans, dp[M][i][0]);
	printf ("%d\n", ans);
	
	return 0;
}