#include namespace { #pragma GCC diagnostic ignored "-Wunused-function" #include #pragma GCC diagnostic warning "-Wunused-function" using namespace std; using namespace atcoder; #define rep(i,n) for(int i = 0; i < (int)(n); i++) #define rrep(i,n) for(int i = (int)(n) - 1; i >= 0; i--) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) template bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; } template bool chmin(T& a, const T& b) { if (b < a) { a = b; return true; } else return false; } using ll = long long; using P = pair; using VI = vector; using VVI = vector; using VL = vector; using VVL = vector; using mint = modint998244353; void square(vector& a) { int n = a.size(); int z = (int)internal::bit_ceil((unsigned int)(n + n - 1)); a.resize(z); internal::butterfly(a); for (int i = 0; i < z; i++) { a[i] *= a[i]; } internal::butterfly_inv(a); a.resize(n + n - 1); mint iz = mint(z).inv(); for (int i = 0; i < n + n - 1; i++) a[i] *= iz; } } int main() { ios::sync_with_stdio(false); cin.tie(0); int n, k; cin >> n >> k; vector p{1}; auto mul = [&](vector& f) { int sz = f.size(); f.resize(sz + 9); rrep(i, sz - 1) f[i+10] -= f[i]; rep(i, sz + 8) f[i+1] += f[i]; }; mul(p); int n2 = n / 2; rrep(i, __lg(n2)) { square(p); if (n2 >> i & 1) mul(p); } auto q = p; if (n % 2) mul(q); mint ans; rep(x, 11) { static vector px, qx; px.clear(), qx.clear(); for(int i = x; i < p.size(); i += 11) px.emplace_back(p[i]); for(int i = x; i < q.size(); i += 11) qx.emplace_back(q[i]); auto rx = convolution(px, qx); rep(i, rx.size()) { int j = 2 * x + 11 * i; if (j % 9 == 0) ans += rx[i] * mint(j).pow(k); } } cout << ans.val() << '\n'; }