func main() var n: int :: cui@inputInt() var m: int :: cui@inputInt() var a: []int :: #[m + 1]int for i(0, m - 1) do a[i] :: cui@inputInt() end for do a[m] :: 0 do a.sort() var ans: int :: lib@intMax for i(0, m - n) var l: int :: a[i] * -1 var r: int :: a[i + n] if(l * r >= 0) do ans :: [ans, [l * 2 + r, l + r * 2].min()].min() end if end for do cui@print("\{ans}\n") end func