题目描述
We have a tree with $2^N-1$ vertices.
The vertices are numbered $1$ through $2^N-1$. For each $1\leq i < 2^{N-1}$, the following edges exist:
- an undirected edge connecting Vertex $i$ and Vertex $2i$,
- an undirected edge connecting Vertex $i$ and Vertex $2i+1$.
There is no other edge.
Let the distance between two vertices be the number of edges in the simple path connecting those two vertices.
Find the number, modulo $998244353$, of pairs of vertices $(i, j)$ such that the distance between them is $D$.