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