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;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

const ll MOD = 998244353;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	string s; cin >> s;
	ll k; cin >> k;
	
	vl a;
	ll cur = 0;
	for (char c: s) {
		if (c == '0') a.pb(cur), cur = 0;
		else cur++;
	}
	a.pb(cur);
	reverse(all(a));

	ll sum = 0;
	vvl dp = {{1}}; // dp[given][rem], 0 <= rem <= given <= sum

	for (ll x: a) {
		ll nsum = min(sum+x,k);
		vvl ndp(nsum+1, vl(2*nsum+1));

		FOR(given,0,sum+1) FOR(rem,0,given+1) if (dp[given][rem]) {
			FOR(here,-rem,x+1) {
				ll ngiven = given + max(here,0LL);
				if (ngiven > k) continue;
				ll nrem = rem + here;
				ndp[ngiven][nrem] += dp[given][rem];
			}
		}

		dp = ndp, sum = nsum;

		FOR(given,0,sum+1) FOR(rem,0,given+1) dp[given][rem] %= MOD;
	}
	
	ll res = 0;
	FOR(given,0,sum+1) res += dp[given][0];
	res %= MOD;
	cout << res << endl;
}