output_description: Print the minimum time required to light K candles.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N K
      x_1 x_2 ... x_N
attempt: a = [list(map(int, input().split())) for i in range(2)]
  k = a[0][1]
  
  num_list = a[1]
  
  positive_list = []
  negative_list = []
  
  ans_positive = []
  ans_negative = []
  
  ans_list = []
  
  for _ in num_list:
      if _ > 0:
          positive_list.append(_)
      elif _ < 0:
          negative_list.insert(0, _)
      else:
          if num_list != [0]:
          k -= 1
  
  for _ in list(range(len(positive_list))):
      if not 0 <= k - _ - 2 < len(negative_list):
          continue
      ans_positive.append(2 * positive_list[_] - negative_list[k - _ - 2])
  
  for _ in list(range(len(negative_list))):
      if not 0 <= k - _ - 2 < len(positive_list):
          continue
      ans_negative.append(-2 * negative_list[_] + positive_list[k - _ - 2])
  
  if ans_positive:
      ans_list.append(min(ans_positive))
  
  if ans_negative:
      ans_list.append(min(ans_negative))
  
  if k <= len(positive_list):
      ans_list.append(positive_list[k - 1])
  
  if k <= len(negative_list):
      ans_list.append(-1 * negative_list[k - 1])
  
  if ans_list == []:
      print(0)
  
  else:
      print(min(ans_list))
problem_description: Statement
  
  There are N candles placed on a number line. The i-th candle from the left is
  placed on coordinate x_i. Here, x_1 < x_2 < ... < x_N holds.
  
  Initially, no candles are burning. Snuke decides to light K of the N candles.
  
  Now, he is at coordinate 0. He can move left and right along the line with
  speed 1. He can also light a candle when he is at the same position as the
  candle, in negligible time.
  
  Find the minimum time required to light K candles.
samples: [{"input": "5 3\n    -30 -10 10 20 50", "output": "40\n    \n\nHe should move and light candles as follows:\n\n  * Move from coordinate 0 to -10.\n  * Light the second candle from the left.\n  * Move from coordinate -10 to 10.\n  * Light the third candle from the left.\n  * Move from coordinate 10 to 20.\n  * Light the fourth candle from the left.\n\n* * *"}, {"input": "3 2\n    10 20 30", "output": "20\n    \n\n* * *"}, {"input": "1 1\n    0", "output": "0\n    \n\n  * There may be a candle placed at coordinate 0.\n\n* * *"}, {"input": "8 5\n    -9 -7 -4 -3 1 2 3 4", "output": "10"}]