public int IntegerBreak(int n)

{

if (n == 2) return 1;

if (n == 3) return 2;

```
switch (n % 3)
{
case 0: return (int)Math.Pow(3, (n / 3));
case 2: return (int)Math.Pow(3, (n - 2) / 3) * 2;
default: return (int)Math.Pow(3, (n - 4) / 3) * 4;
}
}
```