time limit per test 2 second memory limit per test 256 megabytes
You want to process a sequence of n distinct integers by swapping two adjacent sequence elements until the sequence is sorted in ascending order.
There are several test cases, please process till EOF.
For each test case, the first line contains integer n (1≤n≤10^5). The second line contains n space-separated integers a1,a2,…,an (1≤ai≤10^9).
For each test case, output the minimum times of swapping in one line.