Given N space separated integers. Your task is to arrange them such that the summation M of the absolute differences between every two adjacent numbers is maximum.
Input:
First line of the input contains an integer N.
Second line contains N space separated integers Ai.
Output:
Print the above described M.
Constraints:
One of the best arrangements is (1,7,2), M=|1−7|+|7−2|=11