modify merge sort to count the number of inversions in(nlgn) time.

the result is too large for the type int or long.