#P1593. Divisor Sum of Power

    ID: 14879 Type: Default 1000ms 256MiB

Divisor Sum of Power

Divisor Sum of Power

Given two integers \(a\) and \(b\), compute the sum of all divisors of \(a^b\). Since the result can be very large, output the result modulo \(9901\).

Note: The number \(a^b\) may be huge to compute directly. Instead, factorize \(a\) so that if \(a = p_1^{k_1} p_2^{k_2} \cdots p_n^{k_n}\), then \(a^b = p_1^{k_1 b} p_2^{k_2 b} \cdots p_n^{k_n b}\) and the sum of divisors is given by:

\[ S = \prod_{i=1}^{n} \frac{p_i^{k_i b+1} - 1}{p_i - 1} \]

Output \(S \bmod 9901\).

inputFormat

The input consists of two space-separated integers \(a\) and \(b\).

outputFormat

Output a single integer representing the sum of divisors of \(a^b\) modulo \(9901\).

sample

2 3
15