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 IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 303, M = 998244353;

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

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

signed main()
{
	IO_OP;
	
	string s;
	int k;
	cin >> s >> k;
	k = min(k, (int)s.size());
	vi v;
	int cnt = 0;
	for(char c:s) {
		if(c == '0') {
			v.PB(cnt);
			cnt = 0;
		} else {
			cnt++;
		}
	}
	v.PB(cnt);
	for(int i = 0; i < v.size(); i++) {
		for(int j = 0; j <= k; j++) {
			for(int l = 0; l + j <= k; l++) {
				if(i == 0) {
					if(j == 0) dp[i][j][l] = 1;
				} else {
					// take
					for(int take = 0; take <= v[i] && take <= j; take++) {
						add(dp[i][j][l], dp[i-1][j-take][l + take]);
					}					
					// put
					for(int put = 1; put <= l; put++) {
						add(dp[i][j][l], dp[i-1][j][l - put]);
					}
				}
			}
		}
	}
	int ans = 0;
	for(int i = 0; i <= k; i++)
		add(ans, dp[v.size() - 1][i][0]);
	cout << ans << endl;
}