```
class Solution
{
public int integerBreak(int n)
{
int prod = 1;
if(n==2) return 1;
if(n==3) return 2;
switch(n%3)
{
case 0:
prod = (int)Math.pow(3,n/3);
break;
case 1:
prod = 2 * 2 * (int)Math.pow(3, (n-4)/3);
break;
case 2:
prod = 2 * (int)Math.pow(3, (n-2)/3);
break;
}
return prod;
}
}
```