AdvancedRating 1900
Double Inversions
Count the pairs i < j with aᵢ > 2·aⱼ.
Input
n, then n integers.
Output
One integer.
Sample 1
Input
5 1 3 2 3 1
Output
2
Sample 2
Input
5 2 4 3 5 1
Output
3
Output appears heren, then n integers.
One integer.
5 1 3 2 3 1
2
5 2 4 3 5 1
3
Output appears here