https://mirror.codeforces.com/contest/1983/problem/D
In this problem. Count inversion concept comes into play but why ?? What is the exact intuition behind it? Like why only count inversion. and what are the other type of problems where this concept is used.