CF797A.k-Factorization

传统题 时间 2000 ms 内存 256 MiB 5 尝试 1 已通过 1 标签

k-Factorization

Given a positive integer n, find k integers (not necessary distinct) such that all these integers are strictly greater than 1, and their product is equal to n.

Input

The first line contains two integers n and k (2 ≤ n ≤ 100000, 1 ≤ k ≤ 20).

Output

If it's impossible to find the representation of n as a product of k numbers, print -1.

Otherwise, print k integers in any order. Their product must be equal to n. If there are multiple answers, print any of them.

Samples

100000 2
2 50000 
100000 20
-1
1024 5
2 64 2 2 2 

在线编程 IDE

建议全屏模式获得最佳体验