<jupyter_start><jupyter_text>说明：    给定一个正整数n，请将其分解为至少两个正整数的和，并使这些整数的乘积最大化。    返回您可以获得的最大产品。Example 1:    Input: 2    Output: 1    Explanation: 2 = 1 + 1, 1 × 1 = 1.Example 2:    Input: 10    Output: 36    Explanation: 10 = 3 + 3 + 4, 3 × 3 × 4 = 36.Note:     1、你可以假设n不小于2，也不大于58。<jupyter_code>class Solution:
    def integerBreak(self, n: int) -> int:
        if n == 2 or n == 3: return n
        
        dp = [0] * (n + 1)
        for i in range(4):
            dp[i] = i
        
        for i in range(4, n + 1):
            for j in range(2, i // 2 + 1):
                dp[i] = max(dp[i], dp[j] * dp[i-j])
        print(dp)
        return dp[-1]
class Solution:
    def integerBreak(self, n: int) -> int:
        if n == 2 or n == 3: return n
        if n % 3 == 0: 
            return pow(3, n // 3)
        elif n % 3 == 1: 
            return pow(3, n // 3 - 1) * 4
        else:
            return pow(3, n // 3) * 2
solution = Solution()
solution.integerBreak(10)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.14328358208955225, 'fraction_numerical': 0.05572139303482587, 'mean_word_length': 1.6473684210526316, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '643079', 'license': 'Apache-2.0', 'n_tokens_mistral': 458, 'n_tokens_neox': 415, 'n_words': 119, 'path': 'Dynamic Programming/0929/343. Integer Break.ipynb', 'repo_name': 'YuHe0108/Leetcode', 'size': '1005'}