#P1887. 乘积最大3
乘积最大3
Description
Find positive integers that sum to such that their product is as large as possible. Among all optimal solutions, output the lexicographically smallest one.
Input Format
One line containing two positive integers .
Output Format
Output positive integers that sum to and whose product is as large as possible, separated by spaces. The sequence should be the lexicographically smallest among all optimal solutions.
6 3
2 2 2
Hint
For 100% of the testdata, , . It is guaranteed that .
Translated by ChatGPT 5
京公网安备 11011102002149号