sum of the differences of the sorted values in C, very interesting