You are given an array A of length N and an integer M. Jihak wrote the program below.
for i <- 1 to M do
for j <- i+1 to N do
if A[i] > A[j] then
swap(A[i], A[j])
The array is 1-indexed, and swap(A[i], A[j]) exchanges the values of the two elements. Count how many times swap is called before the program ends.
The input holds several test cases. The first line of each test case has two natural numbers N and M. (1≤N,M≤99999)
The second line has the elements A[1],A[2],…,A[N] of the array A, separated by spaces. (−109≤A[i]≤109)
The input runs to the end of the file and holds at most 20 test cases.
For each test case, print the number of swap calls on one line.