#ARC101A. [ABC107C] Candles

[ABC107C] Candles

Score : 300300 points

Problem Statement

There are NN candles placed on a number line. The ii-th candle from the left is placed on coordinate xix_i. Here, x1<x2<...<xNx_1 < x_2 < ... < x_N holds.

Initially, no candles are burning. Snuke decides to light KK of the NN candles.

Now, he is at coordinate 00. He can move left and right along the line with speed 11. 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 KK candles.

Constraints

  • 1N1051 \leq N \leq 10^5
  • 1KN1 \leq K \leq N
  • xix_i is an integer.
  • xi108|x_i| \leq 10^8
  • x1<x2<...<xNx_1 < x_2 < ... < x_N

Input

Input is given from Standard Input in the following format:

NN KK

x1x_1 x2x_2 ...... xNx_N

Output

Print the minimum time required to light KK candles.

5 3
-30 -10 10 20 50
40

He should move and light candles as follows:

  • Move from coordinate 00 to 10-10.
  • Light the second candle from the left.
  • Move from coordinate 10-10 to 1010.
  • Light the third candle from the left.
  • Move from coordinate 1010 to 2020.
  • Light the fourth candle from the left.
3 2
10 20 30
20
1 1
0
0
  • There may be a candle placed at coordinate 00.
8 5
-9 -7 -4 -3 1 2 3 4
10