from functools import lru_cache nmax = 2*10**5; mod = 998244353 @lru_cache(maxsize=None) def main(n,m): if m==1: return 1 if n==m: return pow(2,n-1,mod) return (main(n-1,m-1)+main(n-1,m))%mod for _ in range(int(input())): n,m = map(int,input().split()) print(main(n,m)*main(n+1,n)%mod)