(a) Find the rearrangement
![\{a_1, \dots , a_n\}](/media/m/a/d/8/ad8a9a821546c065fc3150b039bcc335.png)
of
![\{1, 2, \dots, n\}](/media/m/e/3/e/e3eca4a3d2f25d6cd161fd375b8050ef.png)
that maximizes
![a_1a_2 + a_2a_3 + \cdots + a_na_1 = Q.](/media/m/8/6/9/86985116da65eaa7120fa9a6abfe945e.png)
(b) Find the rearrangement that minimizes
%V0
(a) Find the rearrangement $\{a_1, \dots , a_n\}$ of $\{1, 2, \dots, n\}$ that maximizes
$$a_1a_2 + a_2a_3 + \cdots + a_na_1 = Q.$$
(b) Find the rearrangement that minimizes $Q.$