Consider the following optimization problem in positive integers $n\_1, n\_2, n\_3$.


$$\begin{array}{ll} \text{maximize} & n\_1(n\_2+n\_3)\\ \text{subject to} & n\_1+n\_2+n\_3 = N\end{array}$$


If $n\_1, n\_2, n\_3$ were reals, the solution would be $n\_1 = \frac N2$ and $n\_2 = n\_3$. However, in my problem, $n\_1, n\_2, n\_3$ are positive integers. Please help me solve this quadratic integer optimization problem. 



A simple quadratic integer optimization problem
It is readily apparent that:


1. if $N \le 2$, the problem is infeasible
2. if $N = 3$, the optimal solution is [1,1,1]
3. If $N = 4$, the optimal solution is [2,1,1]
4. If $N \ge 5$ and odd, then the optimal solutions are


a) $n\_1 = \lfloor N/2 \rfloor$, $n\_2$ and $n\_3$ being any combination of positive integers summing to $N - n\_1$


b) $n\_1 = \lceil N/2 \rceil$, $n\_2$ and $n\_3$ being any combination of positive integers summing to $N - n\_1$
5. If $N \ge 6$ and even, then the optimal solutions are $n\_1 = N/2$, $n\_2$ and $n\_3$ being any combination of positive integers summing to $N/2$


