K-th Prime Factor
Write \(n\) as a non-decreasing sequence of prime factors with multiplicity and find its \(k\)-th element.
Input
One line containing \(n\) and \(k\).
The input satisfies:
- \(1 <= n, k <= 10^9\)
Output
Print the \(k\)-th prime factor, or -1 if fewer than \(k\) factors exist.
Example
Input
28 3
Output
7
Comments