#include #include using namespace std; using namespace atcoder; typedef modint998244353 mint; typedef long long ll; //defmodfact const int COMinitMAX = 500000; mint fact[COMinitMAX+1], factinv[COMinitMAX+1]; void modfact(){ fact[0] = 1; for (int i=1; i<=COMinitMAX; i++){ fact[i] = fact[i-1] * i; } factinv[COMinitMAX] = fact[COMinitMAX].inv(); for (int i=COMinitMAX-1; i>=0; i--){ factinv[i] = factinv[i+1] * (i+1); } } mint cmb(int a, int b){ if (a> h >> w; vector arr1(h+1); vector arr2(w+1); for (int i=0; i<=h/2; i++){ arr1[h-i] = factinv[i] * factinv[h-2*i]; } for (int i=0; i<=w/2; i++){ arr2[w-i] = factinv[i] * factinv[w-2*i]; } vector arr = convolution(arr1, arr2); mint ans = 0; for (int i=0; i<(int)arr.size(); i++){ ans += fact[i] * arr[i]; } cout << ans.val() << endl; }