output_description: Print the maximum possible sum of the absolute differences between the
  adjacent elements after arranging the given integers in a row in any order you
  like.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1
      :
      A_N
attempt: emp_list =[]
  answer_list =[]
  
  n = int(input())
  for i in range(n):
      i = int(input())
      emp_list.append(i)
  emp_list.sort()
  
  ef min_list(the_list):
      if len(the_list) > 0:
          x = the_list.pop(0)
          return x
      else:
          pass
  
  def max_list(the_list):
      if len(the_list) > 0:
          x = the_list.pop()
          return x
      else:
          pass
  
  m = min_list(emp_list)
  answer_list.append(m)
  
  while emp_list != 0:
      ma = max_list(emp_list)
      answer_list.append(ma)
      if len(emp_list) == 0:
          break
      else:
          mb = max_list(emp_list)
          answer_list.insert(0,mb)
      if emp_list == 0:
          break
      else:
          na = min_list(emp_list)
          answer_list.append(na)
      if emp_list == 0:
          break
      else:
          nb = min_list(emp_list)
          answer_list.insert(0,nb)
  print(answer_list)
problem_description: Statement
  
  You are given N integers; the i-th of them is A_i. Find the maximum possible
  sum of the absolute differences between the adjacent elements after arranging
  these integers in a row in any order you like.
samples: [{"input": "5\n    6\n    8\n    1\n    2\n    3", "output": "21\n    \n\nWhen the integers are arranged as 3,8,1,6,2, the sum of the absolute\ndifferences between the adjacent elements is |3 - 8| + |8 - 1| + |1 - 6| + |6\n- 2| = 21. This is the maximum possible sum.\n\n* * *"}, {"input": "6\n    3\n    1\n    4\n    1\n    5\n    9", "output": "25\n    \n\n* * *"}, {"input": "3\n    5\n    5\n    1", "output": "8"}]