AtCoder Grand Contest 024
E
Sequence Growing Hard
AtCoder
⌀ 3001
原题
← DF →
翻译中…

Problem Statement

翻译中…

Find the number of the possible tuples of sequences $(A_0,A_1,...,A_N)$ that satisfy all of the following conditions, modulo $M$:

翻译中…
  • For every $i$ $(0\leq i\leq N)$, $A_i$ is a sequence of length $i$ consisting of integers between $1$ and $K$ (inclusive);
  • For every $i$ $(1\leq i\leq N)$, $A_{i-1}$ is a subsequence of $A_i$, that is, there exists $1\leq x_i\leq i$ such that the removal of the $x_i$-th element of $A_i$ would result in a sequence equal to $A_{i-1}$;
  • For every $i$ $(1\leq i\leq N)$, $A_i$ is lexicographically larger than $A_{i-1}$.
翻译中…

Constraints

翻译中…
  • $1 \leq N,K \leq 300$
  • $2 \leq M \leq 10^9$
  • $N$, $K$ and $M$ are integers.
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

N K M

翻译中…

Output

翻译中…

Print the number of the possible tuples of sequences $(A_0,A_1,...,A_N)$, modulo $M$.

翻译中…

样例

Input #1
2 2 100
Output #1
5
Five tuples below satisfy the conditions: - $(),(1),(1,1)$ - $(),(1),(1,2)$ - $(),(1),(2,1)$ - $(),(2),(2,1)$ - $(),(2),(2,2)$
Input #2
4 3 999999999
Output #2
358
Input #3
150 150 998244353
Output #3
186248260
题目信息
题号
agc024_e
时间限制
2 s
内存限制
1024 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。