Java Bài 4.A20: Thừa số nguyên tố thứ K.


LÀM BÀI

Points: 10 (partial)
Time limit: 2.0s
Memory limit: 64M

Author:
Problem type

Đưa ra số nguyên tố thứ k trong phân tích thừa số nguyên tố của một số nguyên dương n. Ví dụ n=28, k=3 ta có kết quả là 7 vì 28=2x2x7.

Input Format

2 số n,k(1 ≤n,k≤10^9).

Constraints

.

Output Format

In ra thừa số nguyên tố thứ k của n, nếu n không có thừa số nguyên tố thứ k thì in ra -1.

Ví dụ:

Dữ liệu vào
28 3
Dữ liệu ra
7

Comments

There are no comments at the moment.

Zalo