问题4151--suquence

4151: suquence

[命题人 : ]
时间限制 : 1.000 sec  内存限制 : 128 MB

题目描述

Here is a sequence whose length is B.Each position of sequence contains a number.
Every number is between 1 and A.Now your task is how many different sequences there are?
The answer may be very large.Please output the answer mod C.

输入

The input consists of multiple test cases.Each test case contains 3 interge A,B,C.
(1 <= A, C <= 1000) (0 <= B <= 1000000000)

输出

For each test cases, print the answer mod C.

样例输入 Copy

2 3 10000
2 3 5

样例输出 Copy

8
3

来源/分类