#include #include using namespace std; using namespace atcoder; typedef modint mint; typedef long long ll; mint Garner(vector m,vector r){ int n = m.size(); vector t(n); for(int i=0; i vector convolution_mint(vector a,vector b){ static constexpr unsigned long long M0 = 998244353; static constexpr unsigned long long M1 = 754974721; static constexpr unsigned long long M2 = 469762049; vector aa(a.size()),bb(b.size()); for(int i=0; i(aa,bb); auto c1 = convolution(aa,bb); auto c2 = convolution(aa,bb); vector ret(c0.size()); vector m = {M0,M1,M2}; for(int i=0; i r = {c0[i],c1[i],c2[i]}; vector t(3); for(int j=0; j<3; j++){ long long cur = 0LL; long long cm = 1LL; for(int k=0; k> n; vector a(n+1); for (int i=0; i> x; a[i] = x; } int m; cin >> m; vector b(m+1); for (int i=0; i> x; b[i] = x; } vector c = convolution_mint(a, b); int ind = 0; for (int i=0; i