O(log N)  simple solution using math logic
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(log N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(1)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    int integerBreak(int n) {\n    if(n==2||n==3) return n-1;\n    int r=n%3;  int q=n/3; int ans=pow(3,q);   \n    if(r==0) return ans;\n    if(r==1) return pow(3,q-1)*4;\n    if(r==2) return ans*2;\n    return 0;\n    }\n};\n```
['Math', 'C++']