Score : $600$ points
There is a regular $N$-gon with side length $D$.
Starting from a vertex, we place black or white stones on the circumference at intervals of $1$. As a result, each edge of the $N$-gon will have $(D+1)$ stones on it, for a total of $ND$ stones.
How many ways are there to place stones so that all edges have the same number of white stones on them? Find the count modulo $998244353$.
Input is given from Standard Input in the following format:
$N$ $D$
Print the answer.
3 2
10
There are $10$ ways, as follows:
299792458 3141
138897974
Find the count modulo $998244353$.