In the first example, there are following segments:
\begin{itemize}
\item $[1;1]$ --- $\operatorname{sum}[1;1] \times \operatorname{gcd}[1;1]$ = $3 \times 3$ = $9$;

\item $[1;2]$ --- $\operatorname{sum}[1;2] \times \operatorname{gcd}[1;2]$ = $6 \times 3$ = $18$;

\item $[1;3]$ --- $\operatorname{sum}[1;3] \times \operatorname{gcd}[1;3]$ = $8 \times 1$ = $8$;

\item $[2;2]$ --- $\operatorname{sum}[2;2] \times \operatorname{gcd}[2;2]$ = $3 \times 3$ = $9$;

\item $[2;3]$ --- $\operatorname{sum}[2;3] \times \operatorname{gcd}[2;3]$ = $5 \times 1$ = $5$;

\item $[3;3]$ --- $\operatorname{sum}[3;3] \times \operatorname{gcd}[3;3]$ = $2 \times 2$ = $4$.

\end{itemize}