#P6596. How Many of Them
How Many of Them
Problem Description
In an undirected connected graph, if removing an edge makes the graph split into two disconnected parts, then this edge is called a bridge.
Find the number of undirected connected graphs that satisfy the following conditions:
-
The graph consists of labeled vertices.
-
The number of bridges is at most .
-
There are no multiple edges and no self-loops.
Output the answer modulo .
Input Format
Only one line with two integers and .
Output Format
One integer, representing the answer.
3 3
4
5 1
453
Hint
Constraints: , .
Source: Gennady Korotkevich (tourist), ITMO University.
Translated by ChatGPT 5