5794: 整数拆分

Memory Limit:128 MB Time Limit:1.000 S
Judge Style:Text Compare Creator:
Submit:3 Solved:2

Description

给定一个正整数 n ,将其拆分为 k 个 正整数 的和( k >= 2 ),并使这些整数的乘积最大化。

返回 你可以获得的最大乘积 。

Input

输入: n = 10 

Output

输出: 36
解释: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36。

Sample Input Copy

10

Sample Output Copy

36

HINT

  • 2 <= n <= 58