[BOJ 8293] Prime prime power
View as PDF
Submit solution
Assembly, Awk, C, C++, Java, Pascal, Perl, Python, Sed, Text
Points:
4
Time limit:
5.0s
Memory limit:
128M
Problem types
Allowed languages
In this problem we are interested only in prime prime powers, i.e., numbers of the form ab, where a and b are prime numbers. For a given number n, we want to find the k-th smallest prime prime power greater than n.
입력 형식
The first and only line of the input contains two integers n and k (1 ≤ n ≤ 1018, 1 ≤ k ≤ 100,000).
출력 형식
The first and only line of output should contain one integer m, such that m is the k-th smallest prime prime power greater than n.
예제 입력 1
22 1
예제 출력 1
25
예제 입력 2
22 2
예제 출력 2
27
Comments