Toggle navigation
点码成金编程
F.A.Qs
ProblemSet
Source/Category
Status
Ranklist
Contest
Login
Home
=>
ProblemSet
=> 6.1-21:整数划分
Problem2162--6.1-21:整数划分
2162: 6.1-21:整数划分
Time Limit:
1
Sec
Memory Limit:
128 MB
Submit:
0
Solved:
1
[
Submit
] [
Status
] [ Creator:
][ 参考程序 ]
Description
从文件中读入一个正整数 n(10≤n≤31000)。要求将 n 写成若干个正整数之和,并且使这些正整数的乘积最大。
例如,n=13,则当 n 表示为 4+3+3+3(或 2+2+3+3+3)时,乘积 =108 为最大。
Input
一行一个正整数 n。
Output
第 1 行输出一个整数,为最大乘积的位数。
第 2 行输出最大乘积的前 100 位,如果不足 100 位,则按实际位数输出最大乘积。
Sample Input
Copy
13
Sample Output
Copy
3 108
HINT
对于全部数据,10≤n≤31000,同时保证最大乘积的位数不超过 5000 位。
Source/Category
高精度
FFT