import sys input = sys.stdin.readline from functools import lru_cache @lru_cache(maxsize=None) def f(n,k): if n==1: if k==1: return 2 else: return 0 if n==2: if k==1: return 5 if k==2: return 2 if k==3: return 1 return 0 if k==1: ANS=pow(2,pow(2,n,mod-1)-2,mod) else: ANS=0 for i in range(k+1): ANS+=f(n-1,i+1)*f(n-1,k-i) ANS%=mod return ANS mod=998244353 T=int(input()) for tests in range(T): N,K=map(int,input().split()) ANS=f(N,K) print(ANS%mod)