首页 > 试题广场 >

Calculating sums

[编程题]Calculating sums

Niuniu likes calculating sums. He has recently learnt how to calculate sums using various methods. Here is one of them:

Note that [x] is 1 when x is true and 0 when x is false.
Can you calculate the sum? The answer may be large, so please calculate the sum modulo a given number K.


输入描述:
The only line contains three integers N, M, K.
1 ≤ N ≤ 109, 1 ≤ M ≤ 106, 1 ≤ K ≤ 109


输出描述:
Print a single line with one number, which is the answer.
示例1

输入

2 3 3

输出

0