#P6810. GCD Tau Summation Modulo

    ID: 20017 Type: Default 1000ms 256MiB

GCD Tau Summation Modulo

GCD Tau Summation Modulo

Leasier was caught playing Minecraft, so he must compute the value of the following expression:

$$ \displaystyle S =\sum_{i = 1}^n \sum_{j = 1}^m \tau(i)\,\tau(j)\,\tau(\gcd(i, j)) $$

Here, \(\tau(x)\) denotes the number of positive divisors of \(x\). Since the result can be very large, you only need to compute \(S \bmod p\).

If you are not familiar with the mathematical symbols used in this problem, please refer to the hints section.

inputFormat

The input consists of a single line containing three integers n, m, and p, separated by spaces.

outputFormat

Output a single integer: the value of S modulo p.

sample

1 1 100
1