Utility function to print the original indices of the elements of the array
void printIndices ( int n , pair < int , int > a [ ] ) { for ( int i = 0 ; i < n ; i ++ ) cout << a [ i ] . second << " ▁ " ; cout << endl ; }