#P10588. Hypercube Path Counting
Hypercube Path Counting
Hypercube Path Counting
You are given an n-dimensional hypercube where each vertex is represented as a vector \((x_1,x_2,\dots,x_n)\) with each \(x_i\) either \(0\) or \(1\). Starting from the vertex \((0,0,\dots,0)\), you need to take exactly \(m\) moves. In each move, you can traverse one edge of the hypercube: that is, you choose one coordinate and flip its value (from \(0\) to \(1\) or from \(1\) to \(0\)).
Your task is to count the number of ways to reach any vertex that has exactly \(l\) coordinates equal to \(1\) (and \(n-l\) coordinates equal to \(0\)) after exactly \(m\) moves. Since the answer can be very large, output the result modulo \(998244353\).
Note: The order of moves matters.
inputFormat
The input consists of a single line containing three integers \(n\), \(m\), and \(l\) separated by spaces.
- \(n\) is the dimension of the hypercube.
- \(m\) is the number of moves (edges traversed).
- \(l\) is the required number of coordinates that are \(1\) at the destination.
outputFormat
Output a single integer — the number of ways to reach a vertex with exactly \(l\) ones modulo \(998244353\).
sample
3 3 1
21