Hi, I was trying to solve this task: codechef.com/SEPT14/problems/CHEFINV/

The editorial is here: discuss.codechef.com/questions/5 ... -editorial

The problem setter's source code: codechef_shared.s3.amazonaws.co ... HEFINV.cpp

I understand how he's counting the total number of inversions using BIT, but the way he solves the queries using those prefix and suffix arrays is unclear to me. Can someone explain to me what those arrays are used for and what they represent ?

Thanks in advance !