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: n, k = map(int, input().split())
  X = list(map(int, input().split()))
  
  count_0 = X.count(0)
  
  if k <= count_0:
      print(0)
      exit()
  
  k -= count_0
  
  neg = [x for x in X if x < 0]
  pos = [x for x in X if x > 0]
  
  neg_count = len(neg)
  pos_count = len(pos)
  
  if not neg:
      print(pos[k-1])
      exit()
  if not pos:
    	print(neg[-k])
      exit()
  
  res = []
  for left in range(1, min(neg_count, k)):
      time1 = neg[-left]
      right = k - left - 1
      if right >= pos_count:
          continue
      elif right < 0:
          res.append(abs(time1))
      else:
          time2 = pos[right]
          res.append(time2-time1*2)
  
  for right in range(min(pos_count, k)):
      time1 = pos[right]
      left = k - right - 1
      if left >= neg_count:
          continue
      elif left <= 0:
          res.append(abs(time1))
      else:
          time2 = neg[-left]
          res.append(time1*2-time2)
  
  
  print(min(res))
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"}]