You need to implement the algorithm for counting inversions. You need to read from the standard input (i.e, the terminal) and output to the standard output (i.e, the screen). - Input format: The first line of the input contains one positive integers
n,1≤n≤10 6
. The next
n
lines contain the
n
integers
A[1],A[2],⋯,A[n]
; every integer is between 0 and
10 8
- Output format: Just output 1 line, which is total number of inversions.