#3669

Balanced K-Factor Decomposition

medium · 40% accepted · 120 likes · top 19%

math · backtracking · number theory

Description

Given two integers n and k, split the number n into exactly k positive integers such that the product of these integers is equal to n.

Return any one split in which the maximum difference between any two numbers is minimized. You may return the result in any order.

Solution