C++ O(n) solution with DP
class Solution {\n    public:\n        int integerBreak(int n) {\n            int dp[n + 1];\n            dp[0] = 0;\n            dp[1] = 1;\n            dp[2] 
    class Solution {\n    public:\n        int integerBreak(int n) {\n            int dp[n + 1];\n            dp[0] = 0;\n            dp[1] = 1;\n            dp[2] = 1;\n            dp[3] = 2;\n            dp[4] = 4;\n            for (int i = 5; i <= n; ++i) {\n                dp[i] = 3 * max(i - 3, dp[i - 3]);\n            }\n            return dp[n];\n        }\n    };\n\n2 => 1, 1 => 1  \n3 => 2, 1 => 2  \n4 => 2, 2 => 4  \n5 => 3, 2 => 6  \n6 => 3, 3 => 9  \n7 => 3, 4 => 12  \n8 => 3, 5 => 18  \n9 => 3, 6 => 27  \n10 => 3, 7 => 36  \n\nBy observation, when you get maximum, one of the num is always 3.   \nAfter 3, the result will be larger than or equal the number itself.
[]