Visitors are drawn to attractions like "Roller Coasters" primarily because of the thrilling height differences. The park has acquired modules, each with a specific height M_i, which can be assembled into a single attraction. Your task is to arrange these modules in such a way that the total height difference, calculated as:
is maximized.
The input begins with a line containing the number of modules (4 \leq N \leq 100). The next line contains natural numbers representing the heights of the modules M_1, M_2, \ldots, M_N (1 \leq M_i \leq 1000). These numbers are separated by spaces.
Output the maximum possible total height difference .
Example 7