Score : 800 points
Find the number, modulo 998244353, of sequences of length N consisting of 0, 1 and 2 such that none of their contiguous subsequences totals to X.
Input is given from Standard Input in the following format:
N X
Print the number, modulo 998244353, of sequences that satisfy the condition.
3 3
14
14 sequences satisfy the condition: (0,0,0),(0,0,1),(0,0,2),(0,1,0),(0,1,1),(0,2,0),(0,2,2),(1,0,0),(1,0,1),(1,1,0),(2,0,0),(2,0,2),(2,2,0) and (2,2,2).
8 6
1179
10 1
1024
9 13
18402
314 159
459765451