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 finish(x) return cout << x << endl, 0
#define ll long long

const int N = 301;

int n, k, dp[N][N][N], mod = 998244353;
string s;

int solve(int idx, int i, int skipped, int t){
    if(t > k) return 0;
    if(idx == n) return skipped == 0;
    int &ret = dp[idx][skipped][t];
    if(ret != -1) return ret;
    ret = 0;
    // 0
    int j = i;
    while(j >= 0 && s[j] != '0') j--;
    if(j != -1){
        int sp = i - j;
        ret += solve(idx + 1, j - 1, skipped + sp, t + sp);
        if(ret >= mod) ret -= mod;
    }
    // 1
    if(s[i] == '1') ret += solve(idx + 1, i - 1, skipped, t);
    else if(skipped > 0) ret += solve(idx + 1, i, skipped - 1, t);
    if(ret >= mod) ret -= mod;
    return ret;
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    memset(dp, -1, sizeof dp);
    cin >> s >> k;
    n = s.size();
    cout << solve(0, n - 1, 0, 0) << endl;
}