#include using namespace std; using ll = long long; #include using mint = atcoder::modint998244353; const int B = 500; mint fac[2<<17],ifac[2<<17]; mint comb(int n,int r){ if(r>n) return 0; return fac[n] * ifac[r] * ifac[n-r]; } int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); fac[0] = 1; for(int i = 1;i<2<<17;i++) fac[i] = fac[i-1] * i; for(int i = 0;i<2<<17;i++) ifac[i] = fac[i].inv(); int t; cin>>t; vector n(t),m(t); for(int i = 0;i>n[i]>>m[i]; vector idx(t); for(int i = 0;i m[j];}); int nn = 1,mm = 1; mint tmp = 1; vector ans(t); for(int i = 0;imm){ tmp += comb(2*mm,nn-1); mm++; } while(m[ni]nn){ mint now = comb(2*mm,nn+1); tmp = (now-tmp)/2; nn++; } while(n[ni]