fn main [ var lines := list_break_to_lines(read_lazy(h[0])); var list1 := empty(int); var list2 := empty(int); for l in lines do [ var b := list_break_whitespace(l); list1 +<= ston(b[0]); list2 +<= ston(b[1]); ] list1 := list_sort(list1); list2 := list_sort(list2); var dist := 0; for i := 0 to len(list1) do dist += abs(list1[i] - list2[i]); write(h[1], ntos(dist) + nl); ]