Minimal Inversions Codechef Solution