Find the maximum and minimum value of this. The below question doesn't have a answer in the answersheet. So I want to know my anser is right or not.
Q) question.
Let the $1 \leq x_i (\in N) \leq 3$, $i \in \{1,2,3,...,6\}$
($N$ is natural number set)
$\sum_{i=1} ^6 x_i = 12 $
then  what is the max and min value of the $\sum_{i=1} ^6 x_i^3$?

My answer is 84 and 48 respectively. 
What do you think? 
Thanks.
P.s. here is my solution.

 A: The possibilities are:
$1 1 1333,
112233,222222,132222$.
The values for $\sum x_i^3$ are $84,72,48,60$.
So I get $84$ and $48$ also.
A: We can do this a little more systematically.  As you've noted, you must have an equal number of $1$s and $3$s.  But $1^3+3^3=28 \gt 16=2^3+2^3$, so any time we have a $(1, 3)$ pair we can always reduce the sum by substituting a pair of $2$s.  Conversely, any time we have a pair of $2$s we can always increase the sum by substituting a $(1, 3)$ pair.  So the maximum has to occur when none of the numbers are $2$, and the minimum has to occur when all of the numbers are $2$.
A: Here is another long winded systematic way:
First the $\max$:
Let $f(t) = (x+t)^3+(y-t)^3$ and note that $f'(t) = 3((x+t)^2-(y-t)^2)$.
If $x \ge y$, then since $f'(t) > 0$ for $t \in (0,1]$, we see that $f(1) > f(0)$.
In particular, if $x_k$ is a feasible point, and $x_i =2, x_j = 2$ ($i \neq j$) then 
$x_i=1, x_j = 3$ is a strictly better solution. Hence there can be at most one $2$.
Suppose there is one $2$.
If $m$ is the number of $1$s and $n$ is the number of $3$s, we must have
$m+n = 5, m+3n=10$ which has no integer solutions. Hence there are no $2$s and
so the maximiser must be $1,1,1,3,3,3$ (ignoring order) for a $\max$ of $84$.
Now the $\min$:
Consider the convex problem (over the reals) $\min \{ \sum_k x^3 | x_k \ge 0, \sum_k x_k = 12 \}$. The feasible set is compact so a solution $x^*$ exists. Note that if $\pi$ is a
permutation, then $(x_{\pi_1}^*,...)$ is also a solution, and since the problem is convex, ${1 \over |\Pi|} \sum_{\pi \in \Pi} x_\pi$ is also a solution, and so
$2,2,2,2,2,2$ is a solution. Since this is feasible for the more constrained problem
$\min \{ \sum_k x^3 | \sum_k x_k = 12, x_k \in \{1,...,6\} \}$, we see it is a solution
and so the $\min$ is $48$.
