Two element of an array , and form an inversion if and .
You will be given the array , you have to find sum of count of inversions for all subarrays.
INPUT:
First line contains a single integer , which denotes the size of the array.
Second line contains spaced integers denoting the elements of the array.
OUTPUT:
A single integer which is the desired answer .
CONSTRAINTS:
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Inversion count for subarray =
Sum of inversion count for all subarrays =