{"raw_statement":[{"iden":"statement","content":"小山有 $n$ 个相同的元素，他想将这 $n$ 个元素分为 $m$ 堆，显然有很多种分法。对于每种分法，定义 $a_i$ 为第 $i$ 堆的元素数量，$b_i=i!\\times a_i$（其中 $i!$ 表示 $i$ 的阶乘），以及 $c=\\sum\\limits_{i=1}^mb_i$。而小山的元力为所有分法的 $c$ 值之和。小山想知道他的元力是多少，由于答案可能很大，所以最终答案应对 $p$ 取模（保证 $p$ 为质数）。"},{"iden":"input","content":"一行三个整数 $n,m,p$，含义见**题目描述**。"},{"iden":"output","content":"一个数表示小山的元力。"},{"iden":"note","content":"### 样例解释\n\n将 $3$ 个元素分为 $2$ 堆的方案为：\n\n1. `0 3`\n2. `1 2`\n3. `2 1`\n4. `3 0`\n\n小山的元力为：$(1!\\times0+2!\\times3)+(1!\\times1+2!\\times2)+(1!\\times2+2!\\times1)+(1!\\times3+2!\\times0)=18$。\n\n### 数据范围\n| 子任务 | 分值 | 限制 |\n| :----------: | :----------: | :----------: |\n| $0$ | $20$ | $n,m\\le5$ |\n| $1$ | $80$ | - |\n\n对于 $100\\%$ 的数据，$1\\le n,m\\le10^6$，$1\\le p\\le10^7$。"}],"translated_statement":null,"sample_group":[["3 2 37","18"]],"show_order":[],"formal_statement":null,"simple_statement":null,"has_page_source":false}