#P4157. [SCOI2006] 整数划分
[SCOI2006] 整数划分
Description
Read a positive integer from the file (). You need to write as a sum of several positive integers, and make the product of these integers as large as possible.
For example, when , if is written as (or ), the product is maximal.
Input Format
One line with a positive integer .
Output Format
Line 1: output an integer, the number of digits of the maximum product.
Line 2: output the first 100 digits of the maximum product. If it has fewer than 100 digits, output the maximum product with its actual number of digits.
13
3
108
Hint
Constraints
For all testdata, , and it is guaranteed that the number of digits of the maximum product does not exceed 5000 digits.
Translated by ChatGPT 5
京公网安备 11011102002149号