Say we are given the positive integers $[1,1,2,2,3]$
We want to know what the maximum number is using only the operators $+$, $\times$.
For this set the maximum operation is $(2+1)\times(2+1)\times3=27$
Now obviously we can see that if there is no number smaller $2$, we just have to calculate the product of those numbers.
Next for any number of $1$s we have to build the maximum amount of $3$s avoiding having a leftover $1$. So $[1,1,1,2]=(1+1+1)\times2=6$. Now my question is: Why is building $3$s the best possible strategy? Does there exist any formal proof as why this strategy works?
This question was inspired by this challenge.
Regarding the tagging: I have absolutely no idea which tags are appropriate, so if you happen know fitting tags, feel free to retag.