DOS is a new single-player game that Kayzin came up with. At the beginning of the game you will be given n cards in a row, each with the number of value $a_i$.
In each "matching" operation you can choose any two cards (we assume that the subscripts of these two cards are $i,j (i < j)$. **Notice that $i$ is less than $j$**), and you will get a score of $(a_i+a_j)×(a_i-a_j)$.
Kayzin will ask you $m$ times. In the k-th query, you need to select four cards from the cards with subscripts $L_k$ to $R_k$, and "match" these four cards into two pairs (i.e., two matching operations, but the subscripts of the cards selected in the two matching operations must be different from each other. That is, a card can only be matched at most once. e.g., if you select four tickets with subscripts $a$, $b$, $c$, and $d$, matching $a$ with $b$ and $c$ with $d$, or matching $a$ with $c$ and $b$ with $d$ are legal, but matching $a$ with $b$ and $b$ with $c$ is not legal), please calculate the maximum value of the sum of the two matching scores.
Note that the queries are independent of each other.