No.3589 Make Ends Meet (Hard)
Problem Statement
There is an undirected complete graph† with vertices $1,2,\dots,N$.
Remove exactly $M$ edges from this graph to create a new undirected graph $G$.
In the remaining graph $G$, we want the shortest distance (number of edges traversed) from vertex $1$ to vertex $N$ to be exactly $K$‡.
Find the number of ways to remove edges that satisfy this condition, modulo $998244353$.
Two ways of removal are considered different if the sets of removed edges are different.
† An "undirected complete graph" is an undirected graph without self-loops or multiple edges in which exactly $1$ edge exists between any $2$ distinct vertices.
‡ If vertex $N$ cannot be reached from vertex $1$, the condition is considered not satisfied.
Constraints
- $2 \leq N \leq {\mathbf{35}}$
- $0 \leq M \leq \dfrac{N(N-1)}{2}$
- $1 \leq K \leq N-1$
- All input values are integers.
Input
The input is given from standard input in the following format.
$N\ M\ K$
Output
Print the answer modulo $998244353$ on 1 line.
Sample
Sample 1
Input
4 2 2
Output
5
First, edge $(1,4)$ must always be removed.
Whichever $1$ of the remaining $5$ edges is removed, the shortest distance from vertex $1$ to vertex $4$ is exactly $2$.
Sample 2
Input
5 5 4
Output
0
There is no way to remove edges such that the shortest distance from vertex $1$ to vertex $5$ is $4$.
Sample 3
Input
35 520 25
Output
843751679
The answer can be very large, so print it modulo $998244353$.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。
siganai