K-th Prime Factor


Submit solution

Points: 100
Time limit: 2.0s
Memory limit: 256M

Author:
Problem types

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

There are no comments at the moment.