n,k = list(map(int,input().split()))

x = list(map(int, input().split()))

ans = 10 **10

rx = x[k-1:]

for i, j in zip(x,rx):

    if ans >= abs(i -j) + min(abs(i),abs(j)):

        ans = abs(i -j) + min(abs(i),abs(j))

print(ans)
n,k = list(map(int, input().split()))

x = list(map(int, input().split()))

print((min(r-l + min(abs(l), abs(r)) for l, r in zip(x,x[k-1:]))))
n, k = list(map(int, input().split()))
x = list(map(int, input().split()))
ans = 10**10
rx = x[k - 1 :]
for i, j in zip(x, rx):
    if ans >= abs(i - j) + min(abs(i), abs(j)):
        ans = abs(i - j) + min(abs(i), abs(j))
print(ans)

n, k = list(map(int, input().split()))
x = list(map(int, input().split()))
print((min(r - l + min(abs(l), abs(r)) for l, r in zip(x, x[k - 1 :]))))

-ans = 10**10 -rx = x[k - 1 :] -for i, j in zip(x, rx): -    if ans >= abs(i - j) + min(abs(i), abs(j)): -        ans = abs(i - j) + min(abs(i), abs(j)) -print(ans) +print((min(r - l + min(abs(l), abs(r)) for l, r in zip(x, x[k - 1 :]))))