Preprocessing the array
void preprocess ( int arr [ ] , int blk_sz , int n , int bit [ ] [ MAX ] ) { for ( int i = 0 ; i < n ; i ++ ) update ( arr [ i ] , i / blk_sz , 1 , bit ) ; } void preprocessUpdate ( int i , int v , int blk_sz , int arr [ ] , int bit [ ] [ MAX ] ) {