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

k-=1

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

print((min(min(abs(x[i])+abs(x[i+k]-x[i]),abs(x[i+k])+abs(x[i+k]-x[i])) for i in range(n-k))))
n,k=list(map(int,input().split()))

k-=1

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

print((min(min(abs(x[i]),abs(x[i+k]))+abs(x[i]-x[i+k])for i in range(n-k))))
n, k = list(map(int, input().split()))
k -= 1
x = list(map(int, input().split()))
print(
    (
        min(
            min(abs(x[i]) + abs(x[i + k] - x[i]), abs(x[i + k]) + abs(x[i + k] - x[i]))
            for i in range(n - k)
        )
    )
)

n, k = list(map(int, input().split()))
k -= 1
x = list(map(int, input().split()))
print((min(min(abs(x[i]), abs(x[i + k])) + abs(x[i] - x[i + k]) for i in range(n - k))))

-print( -    ( -        min( -            min(abs(x[i]) + abs(x[i + k] - x[i]), abs(x[i + k]) + abs(x[i + k] - x[i])) -            for i in range(n - k) -        ) -    ) -) +print((min(min(abs(x[i]), abs(x[i + k])) + abs(x[i] - x[i + k]) for i in range(n - k))))