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;
#define int long long
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int, int> P;
constexpr long long inf = 1e17;
constexpr int mod = 998244353;
int dp[302][302][302];
int a[305];
signed main() {
	string s; cin >> s;
	int N = s.size();
	if(s[N-1]=='1')s.push_back('0');
	int k; cin >> k;
	int cnt = 0, now = 0;
	rep(i, s.size()) {
		if (s[i] == '0') {
			a[now] = cnt;
			now++;
		}
		else cnt++;
	}
	for (int i = N - 1; i > 0; i--)a[i] -= a[i - 1];
	k = min(k, cnt);
	dp[0][0][0] = 1;
	N = now;


	rep(i, N) {
		for(int j=0;j<=k;j++) {
			for(int l=0;l<=j;l++) {
				if (!dp[i][j][l])continue;
				for (int m = j; m <= k; m++) {
					dp[i + 1][m][l] += dp[i][j][l]; dp[i + 1][m][l] %= mod;
				}
				for (int m = l + 1; m <= min(l + a[i], j); m++) {
					dp[i + 1][j][m] += dp[i][j][l]; dp[i + 1][j][m] %= mod;
				}
			}
		}
	}
	int ans = 0;
	rep(i, k + 1) {
		ans += dp[N][i][i]; ans %= mod;
	}
	cout << ans << endl;
}