C2. The integers $a, b, c, d, e, f$ and $g$, none of which is negative, satisfy the following five simultaneous equations:
$$
\begin{array}{l}
a+b+c=2 \\
b+c+d=2 \\
c+d+e=2 \\
d+e+f=2 \\
e+f+g=2 .
\end{array}
$$

What is the maximum possible value of $a+b+c+d+e+f+g$ ?
Solution
All the equations are satisfied when $a=d=g=2$ and $b=c=e=f=0$. In that case we have
$$
\begin{aligned}
a+b+c+d+e+f+g & =2+0+0+2+0+0+2 \\
& =6 .
\end{aligned}
$$

Therefore the maximum possible value of $a+b+c+d+e+f+g$ is at least 6 . However, from the first and fourth equations we obtain
$$
\begin{aligned}
a+b+c+d+e+f+g & =(a+b+c)+(d+e+f)+g \\
& =2+2+g \\
& =4+g .
\end{aligned}
$$

But the fifth equation is $e+f+g=2$ and the integers $e$ and $f$ are non-negative, so that $g$ is at most 2 . Thus $4+g$ cannot exceed 6 , and thus $a+b+c+d+e+f+g$ cannot exceed 6 .
Hence the maximum possible value of $a+b+c+d+e+f+g$ is indeed 6 .
Remark
It is possible to use the same method but with different equations in the second part.