Question 16
Suppose that $(a_{1}, \ldots, a_{20})$ and $(b_{1}, \ldots, b_{20})$ are two sequences of integers such that the sequence $(a_{1}, \ldots, a_{20}, b_{1}, \ldots, b_{20})$ contains each of the numbers $1, \ldots, 40$ exactly once. What is the maximum possible value of the sum
$$
\sum_{i=1}^{20} \sum_{j=1}^{20} \min (a_{i}, b_{j}) ?
$$
$$
\sum_{i=1}^{20} \sum_{j=1}^{20} \min (a_{i}, b_{j}) ?
$$