class Solution:
    def get_max_break(self, n):
        memo = [0, 1]

        for i in range(2, n + 1):
            max_product = 0
            for j in range(1, (i // 2) + 1):
                max_product = max(max_product, max(j, memo[j]) * max(i - j, memo[i - j]))
            memo.append(max_product)

        return memo[-1]
    
    def get_max_break2(self, n):
        memo = [0 for _ in range(n + 1)]
        memo[1] = 1

        for i in range(2, n+1):
            memo[i] = max(max(j, memo[j]) * max(i - j, memo[i - j]) for j in range(1, (i//2) + 1))

        return memo[-1]

solution = Solution()
for i in range(2, 10):
    print('get_max_break({}) = {}'.format(i, solution.get_max_break2(i)))