divide-and-conquer inversion counting