#define MD 998244353 struct AB { Mint a,b; }; inline AB operator*(AB x,AB y){ return {y.a*x.a,y.a*x.b+y.b}; } AB ab[19][262144]; { ll@n,@q; rep(i,n){ rd(ab[0][i].a,ab[0][i].b); } rep(d,1,19){ ll m=1<