Time limit per test: 1.25 second(s) Memory limit: 65536 kilobytes
input: standard output: standard
Let's call aa non-oriented graph such that each pair of different vertices is connected by exactly one edge, colored in any of M different colors. Two colored graphs areif the vertices of the first graph can be renumbered in such a way that it becomes equal to the second graph (i.e. the colors of the edges are the same).
You are given N, M and a prime P. Your task is to find the number of distinct non-isomorphic graphs having N vertices. The number should be output modulo P.
The only line of the input contains three integers N, M, P (1≤ N≤ 53, 1≤ M≤ 1000, N
Output the answer to the problem in the only line of the output.
1 1 2
3 2 97
3 4 97
Novosibirsk SU Contest #2, by Novosibirsk Team #1
Codeforces (c) Copyright 2010-2021 Mike Mirzayanov