atcoder#ABC180F. [ABC180F] Unbranched
[ABC180F] Unbranched
Score : points
Problem Statement
Find the number of graphs with labeled vertices and unlabeled edges, not necessarily simple or connected, that satisfy the following conditions, modulo :
- There is no self-loop;
- The degree of every vertex is at most ;
- The maximum of the sizes of the connected components is exactly .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
3 2 3
3
When the vertices are labeled through , the following three graphs satisfy the condition:
- The graph with edges and ;
- The graph with edges and ;
- The graph with edges and .
4 3 2
6
300 290 140
211917445