A=[*$<][1].split.map(&:to_i).sort A.size%2>0&&A<<0 x,y=A.each_slice(2).to_a.transpose.map{_1.sum.abs} p (x-y).abs