An array of $$$n$$$ integers and $$$q$$$ queries are given. Each query consists of two integers $$$(l, r)$$$:
The first line contains two integers $$$n$$$ and $$$q$$$ — the size of the array and the number of queries.
The second line contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ — the initial elements of the array.
Each of the next $$$q$$$ lines contains two integers $$$l$$$ and $$$r$$$ — the interval $$$[l, r]$$$
For each query, output a single integer on a separate line — the total number of inversions in the array after this operation.
5 3 1 3 5 2 4 2 4 1 5 2 3
2 7 4
5 3 2 1 2 1 1 2 4 1 5 1 3
5 1 5