Maximize Differences

No attempts yetTime limit1sMemory limit256 MB

Problem

Reorder the array to maximize the sum of adjacent absolute differences.

Input

N and array A.

Output

Print the maximum value.