mod = 998244353 l = 4005 m = [[0]*l for _ in range(l)] m[0][0] = 1 for i in range(l): acc = m[i][0] for j in range(1, l): acc += m[i][j] acc %= mod m[min(l-1, i+j)][j] += acc m[min(l-1, i+j)][j] %= mod m[i][j] += m[i][j-1] m[i][j] %= mod for _ in range(int(input())): t, n, k = map(int, input().split()) if n < k: print(0) continue else: print(m[n][k])