The idea is from here https://leetcode.com/discuss/98276/why-factor-2-or-3-the-math-behind-this-problem.

Thanks for lixx2100.

May not solve the test cases of long long, but pass all the current test cases.

```
class Solution {
public:
int integerBreak(int n) {
if(n==2) return 1;
if(n==3) return 2;
if(n%3 == 1) return pow(3,((n-4)/3))*4;
else if(n%3 == 2) return pow(3,(n/3))*2;
else return pow(3,n/3);
}
};
```