What is a good way to calculate max/min of 
$$x\_1 x\_2+y\_1 y\_2+z\_1 z\_2+w\_1 w\_2$$
where $x\_1+y\_1+z\_1+w\_1=a$ and $x\_2+y\_2+z\_2+w\_2=b$ and $x, y, z, w, a, b \in \mathbb{N} \cup \{0 \}$, and please explain your answer (how your result comes out).