maximum and minimum value of $(a+b)(b+c)(c+d)(d+e)(e+a).$ 
Let $a,b,c,d,e\geq  -1$ and $a+b+c+d+e=5.$ Find the maximum and minimum value of $S=(a+b)(b+c)(c+d)(d+e)(e+a).$

I couldn't proceed much, however I think I got the minimum and maximum case.
For minimum, we get $-512$ with equality on $(-1,-1,-1,-1,9).$
For maximum, we get $288$ with equality on   $(-1,-1,-1,4,4).$
 A: For the maximum, you can easily prove that $4$ of the $5$ product terms cannot be negative. Then, the maximum is achieved either all $5$ are positive or only $3$ are positive. In the former case, simple $AM-GM$ gives the maximum of $32.$ For the latter case, assume $a+b\leq 0$ and $b+c\leq 0$ while the other three are non-negative. In that case, $-a-b\leq 2$ and $-b-c\leq 2$ and $d+e = 5-a-b-c\leq 8.$
Then, $$S = (c+d)(d+e)(e+a)(-a-b)(-b-c)\leq 4(c+d)(e+a)(d+e)\leq(c+d+e+a)^2\cdot 8= 8(5-b)^2\leq 8\cdot 36 = 288.$$
Now the other possibility is when two terms involving $4$ different variables are negative - say $a+b\leq 0$ and $c+d\leq 0.$ In this case, $b+c\geq 0$ and so $a+d = (a+b+c+d) - (b+c)\leq 0.$ Finally, $e = 5-a-d -(b+c)\leq 5-a-d\leq 7.$ Now for the kill:
$$S = (-a-b)(-c-d)(d+e)(e+a)(b+c)\leq \dfrac{(e-5)^2}{4}\cdot \dfrac{(e+5)^3}{27}\leq \dfrac{12^3}{27} = 64.$$
You can do similar thing for the minimum.
A: We can solve the problem by substitution.
Step 1: Let
\begin{align}
  &A = a+b \\ 
  &B = b+c \\
  &C = c+d \\
  &D = d+e \\
  &E = e+a \\
\end{align}
Then the problem is equivalent to find the maximum and minimum of $ABCDE$, where $A,B,C,D,E\ge -2$ and $A+B+C+D+E = 10$.
\begin{align}
{}
\end{align}
Step 2: Consider each case separately, according to the sign of $A$, $B$, $C$, $D$, and $E$. Without loss of generality, we only need to consider cases as follows:
\begin{align}
 &(1):~(A,B,C,D,E) = (+,+,+,+,+)\\
 &(2):~(A,B,C,D,E) = (+,+,+,+,-)\\
 &(3):~(A,B,C,D,E) = (+,+,+,-,-)\\
 &(4):~(A,B,C,D,E) = (+,+,-,-,-)\\
 &(5):~(A,B,C,D,E) = (+,-,-,-,-)\\
\end{align}
where + means the number is non-negative, and - means the number is non-positive.
Step 3 (Minimum): Of course, the minimum can occur in cases (2) and (4). First, consider case (2). As your intuition suggested, the minimum occurs when $E=-2$ and $A=B=C=D=3$. We can show this as follows. First, observe that for all $(A,B,C,D,E)$, we have
\begin{align}
  -2ABCD \le ABCDE.
\end{align}
Next, observe that $4(ABCD)^{1/4}\le A+B+C+D = 10-E\le 12$, which implies that $ABCD\le 81$. Thus, in case (2), the minimum of $ABCD$ is $-162$. Similarly, you can find the minimum value under case (4), which is $-512$.
Step 4 (Maximum): In the same vein, the maximum can occur in cases (1), (3), and (5). And their maximum values are $32$, $784/9\approx 87.11$, and $288$.
A: This is the problem of China national in math olympiad here is my proof:
.
.
.
Wlog let $|e|=Max(|a|,|b|,|c|,|d|,|e|)$ so we have $(e+d)(e+a)>0$ (take note we are to find the min at first ) for it to be negative we have $2$ cases one is that all $3$ of $(b+c),(c+d),(a+b)$ are negative which we have from AM_GM that :
$$(-a-b)(-b-c)(-c-d)(d+e)(e+a)\le (\frac{-a-2b-2c-d}{3})^3(\frac{a+d+2e}{2})^2=(\frac{a+d+2e-10}{3})^3(\frac{a+d+2e}{2})^2 \le 512$$
so its done the second case is that only one of them is negative. Let $a+b$ be negative (the way we use AM_GM gives us this freedom to assume this) now we have
$$(-a-b)(b+c)(c+d)(d+e)(e+a)\le (\frac{2(c+d+e)}{5})^5=(\frac{2(5-a-b)}{5})^5\le(\frac{14}{5})^5<  512$$
so we are done here. now we want to find the Max which we do in the ofllowing way.
if all of $a+b,b+c,c+d$ are possitive we have from AM_GM that
$$S\le (\frac{2(a+b+c+d+e)}{5})^5=32<288.$$
the next case is the following . we have $a+b\le0$, $b+c\le0$, $c+d\ge0$,  then by AM_GM
$$(-a-b)(-b-c)(c+d)(d+e)(e+a)\le (\frac{-a-2b-c}{2})^2(\frac{c+d+e+a}{2})^2(d+e)=(\frac{d+e-b-5}{2})^2(\frac{5-b}{2})^2(d+e)\le 288$$
the last case is :
$a+b\le0$, $b+c\ge0$, $c+d\le0$, then by AM_GM we have
$$S=(-a-b)(b+c)(-c-d)(d+e)(e+a)\le (\frac{-a-b-c-d}{2})^2(\frac{b+c+d+e+e+a}{3})^3=(\frac{e-5}{2})^2(\frac{5+e}{3})^3< 288$$
and done done.
