the Little Elephant array consist n positive integer index 1 n Lets denote number index aiThe Little Elephant want count pair integer l r 1lrn sequence ba1a2 alarar1 k inversion an inversion sequence b pair element sequence b change relative order stable sort sequence in word inversion pair integer j 1ijb bibj b length sequence b bj jth elementhelp Little Elephant count number describe pair