#pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include "bits/stdc++.h" using namespace std; #define all(x) begin(x),end(x) template ostream& operator<<(ostream &os, const pair &p) { return os << '(' << p.first << ", " << p.second << ')'; } template::value, typename T_container::value_type>::type> ostream& operator<<(ostream &os, const T_container &v) { string sep; for (const T &x : v) os << sep << x, sep = " "; return os; } #define debug(a) cerr << "(" << #a << ": " << a << ")\n"; typedef long long ll; typedef vector vi; typedef vector vvi; typedef pair pi; const int mxN = 1<<19, oo = 1e9; const long long MOD = 998244353; class mint { public: int d; mint () {d=0;} mint (long long _d) : d(_d%MOD){}; mint operator*(const mint& o) const { return ((ll)d*o.d)%MOD; } mint operator+(const mint& o) const { long long tmp = d+o.d; if(tmp>=MOD) tmp-=MOD; return tmp; } mint operator-(const mint& o) const { long long tmp = d-o.d; if(tmp<0) tmp+=MOD; return tmp; } mint operator^(long long b) const { mint tmp = 1; mint power = *this; while(b) { if(b&1) { tmp = tmp*power; } power = power*power; b/=2; } return tmp; } mint operator/(const mint& o) { return *this * (o^(MOD-2)); } bool operator==(const mint& o) { return d==o.d; } friend mint& operator+=(mint& a, const mint& o) { a.d+=o.d; if(a.d>=MOD) a.d-=MOD; return a; } }; typedef mint cd; void revperm(cd* in, int n) { for(int i=0,j=0;i> 1; (j ^= k) < k; k >>= 1); } } cd w[mxN+1]; // stores w^j for each j in [0,n-1] void precomp() { w[0] = 1; int pw = (MOD-1)/mxN; w[1] = mint(3)^pw; for(int i= 2;i<=mxN;++i) { w[i] = w[i-1]*w[1]; } } void fft(cd* in, int n, bool reverse=false) { int lg = __lg(n); assert(1<>s); for(int j=0;j polymul(vector a, vector b) { int n = a.size(), m = b.size(), ptwo = 1; while(ptwo<(n+m)) ptwo*=2; a.resize(ptwo), b.resize(ptwo); fft(a.data(),ptwo); fft(b.data(),ptwo); for(int i=0;ia or a<0 or b<0) return 0; return fact[a]*ifact[b]*ifact[a-b]; } void precomp2() { fact[0]=1; for(int i=1;i=0;--i) { ifact[i]=ifact[i+1]*(i+1); } } int main() { precomp(); precomp2(); int n,m; cin >> n >> m; vector a(n+1),b(m+1); for(int i=0;i<=n/2;++i) { a[n-i]=ncr(n-i,i)*ifact[n-i]; } for(int i=0;i<=m/2;++i) { b[m-i] = ncr(m-i,i)*ifact[m-i]; } auto c = polymul(a,b); mint ans=0; for(int i=0;i