#abc180f. [abc180_f]Unbranched
[abc180_f]Unbranched
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.
Sample Input 1
3 2 3
Sample Output 1
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 .
Sample Input 2
4 3 2
Sample Output 2
6
Sample Input 3
300 290 140
Sample Output 3
211917445