#P2291. [PA 2011] Prime prime power 质数的质数次方

[PA 2011] Prime prime power 质数的质数次方

Description

Given a number nn, find the kk-th smallest value of aba^b (aa and bb are both prime numbers) such that its value is greater than nn.

Input Format

One line with two integers n,kn, k.

Output Format

Output one integer on a single line as the answer.

22 2
27
22 1
25

Hint

For 100%100\% of the testdata, 1n10181 \le n \le 10^{18}, 1k1051 \le k \le 10^5.

Translated by ChatGPT 5