#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define REP_OVERLOAD(arg1, arg2, arg3, arg4, NAME, ...) NAME #define REP3(i, l, r, s) \ for (int i = int(l), rep3_r = int(r), rep3_s = int(s); i < rep3_r; \ i += rep3_s) #define REP2(i, l, r) REP3(i, l, r, 1) #define REP1(i, n) REP2(i, 0, n) #define rep(...) REP_OVERLOAD(__VA_ARGS__, REP3, REP2, REP1, )(__VA_ARGS__) #define repin(i, l, r) for (int i = int(l), repin_r = int(r); i <= repin_r; ++i) #define RREP_OVERLOAD(arg1, arg2, arg3, arg4, NAME, ...) NAME #define RREP3(i, l, r, s) \ for (int i = int(r) - 1, rrep3_l = int(l), rrep3_s = int(s); i >= rrep3_l; \ i -= rrep3_s) #define RREP2(i, l, r) RREP3(i, l, r, 1) #define RREP1(i, n) RREP2(i, 0, n) #define rrep(...) RREP_OVERLOAD(__VA_ARGS__, RREP3, RREP2, RREP1, )(__VA_ARGS__) #define rrepin(i, l, r) \ for (int i = int(r), rrepin_l = int(l); i >= rrepin_l; --i) #define all(v) v.begin(), v.end() #include #include #include #include namespace rklib { template std::ostream &operator<<(std::ostream &os, const std::vector &v) { os << "["; for (auto d : v) os << d << ", "; return os << "]"; } // a <- max(a, b) template bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; } // a <- min(a, b) template bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; } // if a < 0: a <- b // else: a <- min(a, b) template bool chmin_non_negative(T &a, const T &b) { if (a < 0 || a > b) { a = b; return true; } return false; } // floor(num / den) template T div_floor(T num, T den) { if (den < 0) num = -num, den = -den; return num >= 0 ? num / den : (num + 1) / den - 1; } // ceil(num / den) template T div_ceil(T num, T den) { if (den < 0) num = -num, den = -den; return num <= 0 ? num / den : (num - 1) / den + 1; } } // namespace rklib using namespace std; using namespace rklib; using lint = long long; using ulint = unsigned long long; using pii = pair; using pll = pair; template using vec = vector; template using vvec = vec>; template using vvvec = vec>; #include #include #include #include namespace rklib { template struct Factorial { public: Factorial() : Factorial(0) {} Factorial(int n) { fc.resize(n + 1); inv_fc.resize(n + 1); fc[0] = 1; for (int i = 0; i < n; ++i) fc[i + 1] = fc[i] * (i + 1); inv_fc[n] = 1 / fc[n]; for (int i = n - 1; i >= 0; --i) inv_fc[i] = inv_fc[i + 1] * (i + 1); } T fact(int n) { if (n >= (int)fc.size()) extend(n); return fc[n]; } T inv_fact(int n) { if (n >= (int)fc.size()) extend(n); return inv_fc[n]; } T inv(int n) { assert(n > 0); if (n >= (int)fc.size()) extend(n); return inv_fc[n] * fc[n - 1]; } T comb(int n, int r) { if (n < r || r < 0) return 0; if (n >= (int)fc.size()) extend(n); return fc[n] * inv_fc[r] * inv_fc[n - r]; } T perm(int n, int r) { if (n < r || r < 0) return 0; if (n >= (int)fc.size()) extend(n); return fc[n] * inv_fc[n - r]; } private: std::vector fc; std::vector inv_fc; void extend(int n) { int l = fc.size(); int r = l; while (r <= n) r *= 2; fc.resize(r); inv_fc.resize(r); for (int i = l; i < r; ++i) fc[i] = fc[i - 1] * i; inv_fc[r - 1] = 1 / fc[r - 1]; for (int i = r - 2; i >= l; --i) inv_fc[i] = inv_fc[i + 1] * (i + 1); } }; } // namespace rklib using mint = atcoder::modint998244353; Factorial fc; #include "testlib.h" vec get_h(int m) { vec f(10 * m + 1, 0); rep(i, m + 1) { auto tmp = fc.comb(m, i); if (i % 2 == 1) tmp = -tmp; f[i * 10] = tmp; } vec g(9 * m + 1, 0); rep(i, g.size()) { g[i] = fc.comb(i + m - 1, i); } auto res = atcoder::convolution(f, g); res.resize(9 * m + 1); return res; } int main(int argc, char* argv[]) { registerValidation(argc, argv); int n = inf.readInt(2, 100'000); inf.readSpace(); int k = inf.readInt(1, 100'000); inf.readEoln(); inf.readEof(); auto h0 = get_h((n + 1) / 2); auto h1 = get_h(n / 2); mint ans = 0; rep(d, 11) { auto f = h0; rep(i, f.size()) if (i % 11 != d) f[i] = 0; auto g = h1; rep(i, g.size()) if (i % 11 != d) g[i] = 0; auto h = atcoder::convolution(f, g); for (int i = 0; i < int(h.size()); i += 9) { ans += mint(i).pow(k) * h[i]; } } cout << ans.val() << endl; }