#P2557. [AHOI2002] 芝麻开门

[AHOI2002] 芝麻开门

Description

On the weekend, little Keke takes part in a brain-power surfing challenge and finally reaches the last level, "Open Sesame." The electronic display on the door says: If you can correctly write on the door the sum of all positive integer divisors of nkn^k, and say "Open Sesame," the door will open freely.

For example: n=2n=2, k=3k=3, then nk=8n^k=8. Its positive divisors are 1,2,4,81, 2, 4, 8. If Keke writes their sum 1515 on the door and then says "Open Sesame," the door will open automatically.

It is known that the values nn and kk on the door change from time to time. Please write a program to help Keke compute the answer within the allotted time, so as to win the final prize of the challenge.

Input Format

One line with two positive integers nn and kk.

Output Format

One line with one integer representing the answer.

1 1
1
2 2
7

Hint

1n2161\le n \le 2^{16}, 1k<201\le k \lt 20.

The answer has at most 100100 digits.

Translated by ChatGPT 5