P2291 [PA 2011] Prime prime power Prime Powers with Prime Exponents

Description

Given a number $n$, find the $k$-th smallest value of $a^b$ ($a$ and $b$ are both prime numbers) such that its value is greater than $n$.

Input Format

One line with two integers $n, k$.

Output Format

Output one integer on a single line as the answer.

Explanation/Hint

For $100\%$ of the testdata, $1 \le n \le 10^{18}$, $1 \le k \le 10^5$. Translated by ChatGPT 5