#3669

Balanced K-Factor Decomposition

expert · 1020 · lc medium +32 · 40% accepted · 120 likes · top 19%

Description

Given integers n and k, express n as a product of exactly k positive integers. Among all such factorizations, return any one that minimizes the difference between the largest and smallest factor. The result may be in any order.

Code

1
2
3