#P1887. 乘积最大3

乘积最大3

Description

Find MM positive integers that sum to NN 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 N,MN, M.

Output Format

Output MM positive integers that sum to NN 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, 1N1091 \le N \le 10^{9}, 1M1061 \le M \le 10^{6}. It is guaranteed that NMN \ge M.

Translated by ChatGPT 5