Time Limit: 5000/1000 MS (Java/Others)

Memory Limit: 32768/32768 K (Java/Others)

Xiaoming has just come up with a new way for encryption, by calculating the key from a publicly viewable number in the following way:

Let the public key N = A^{B}, where 1 <= A, B <= 1000000, and a_{0}, a_{1}, a_{2}, …, a_{k-1} be the factors of N, then the private key M is calculated by summing the cube of number of factors of all ais. For example, if A is 2 and B is 3, then N = A^{B} = 8, a_{0} = 1, a_{1} = 2, a_{2} = 4, a_{3} = 8, so the value of M is 1 + 8 + 27 + 64 = 100.

However, contrary to what Xiaoming believes, this encryption scheme is extremely vulnerable. Can you write a program to prove it?

Let the public key N = A

However, contrary to what Xiaoming believes, this encryption scheme is extremely vulnerable. Can you write a program to prove it?

There are multiple test cases in the input file. Each test case starts with two integers A, and B. (1 <= A, B <= 1000000). Input ends with End-of-File.

Note: There are about 50000 test cases in the input file. Please optimize your algorithm to ensure that it can finish within the given time limit.

Note: There are about 50000 test cases in the input file. Please optimize your algorithm to ensure that it can finish within the given time limit.

提交代码