Limits 2s, 512 MB

Your best friend is attending math class at the university. Teacher gave him two problems during the class.

  • What is the sum of divisors of number nn?

  • What is the sum of the square of divisors of number nn?

He was able to solve the first one. But that took him much time. He is also curious about the number of divisors of number nn. But he has to solve it as soon as possible. He wants your help. He is your best friend so you do not want to turn him down. Now you know the number and its sum of divisors, you want to find number of divisors and sum of the square of divisors of that number.

You are given an integer number nn and its sum of divisors ss. You have to tell the number of divisors and the sum of the square of divisors of number nn.

Input

Input starts with an integer TT (0<T5000 < T \le 500), denoting the number of test cases. Each case contains an integer nn (1n10161 \le n \le 10^{16}) denoting the number nn and an integer ss (1s10181 \le s \le 10^{18}) denoting the sum of divisors ss of the number nn.

Output

For each case, print the case number and number of divisors and sum of the square of divisors module 109+710^9+7.

Sample

InputOutput
2
3 4
12 28
Case 1: 2 10
Case 2: 6 210

Submit

Login to submit.

Statistics

24% Solution Ratio
IamHotEarliest, Jan '18
steinumFastest, 0.0s
steinumLightest, 5.5 kB
AnachorShortest, 1790B
Toph uses cookies. By continuing you agree to our Cookie Policy.