atcoder#AGC046F. [AGC046F] Forbidden Tournament
[AGC046F] Forbidden Tournament
Score : points
Problem Statement
Given are integers and , and a prime number . Find the number, modulo , of directed graphs with vertices that satisfy below. Here, the vertices are distinguishable from each other.
- is a tournament, that is, contains no duplicated edges or self-loops, and exactly one of the edges and exists for any two vertices and .
- The in-degree of every vertex in is at most .
- For any four distinct vertices , , , and in , it is not the case that all of the six edges , , , , , and exist simultaneously.
Constraints
- $10^8
- and are integers.
- is a prime number.
Input
Input is given from Standard Input in the following format:
Output
Print the number of directed graphs that satisfy the conditions, modulo .
4 3 998244353
56
Among the graphs with four vertices, are isomorphic to the forbidden induced subgraphs, and the other satisfy the conditions.
7 3 998244353
720
50 37 998244353
495799508