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