SPOILER
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
Let the number be 2*n.
Let the smallest number in the first list be S1.
Let the largest number in the second list be L2.
There are n numbers > n and n numbers <= n, and n numbers in each
list.
If S1 > n, then all numbers in the first list are > n. Then L2 must be
<= n.
If S1 <= n, then at least one number > n is in the second list, so L2
must be > n.
Therefore the first difference is between a number greater than n and
one less than n.
After removing these two numbers there are n-1 numbers > n and n-1
numbers <= n, and n-1 numbers in each list.
The above argument now applies again, so the second difference is
between a number greater than n and one less than n.
This applies similarly to all the steps.
Therefore the sum of differences is equal to the sum from 1 to 2*n -
twice the sum from 1 to n.
This is equal to 1/2*2*n*(2*n+1)-2*1/2*n*(n+1) = 2*n^2+n-n^2-n = n^2,
and so the result of the division is always 4.
Please reply to ilan dot mayer at hotmail dot com
__/\__
\ /
__/\\ //\__ Ilan Mayer
\ /
/__ __\ Toronto, Canada
/__ __\
||