initialising bit array of each block as elements of array cannot exceed 10 ^ 4 so size of bit array is accordingly
int bit [ blk_sz + 1 ] [ MAX ] ; memset ( bit , 0 , sizeof ( bit ) ) ; preprocess ( arr , blk_sz , n , bit ) ; cout << query ( 1 , 3 , 1 , arr , blk_sz , bit ) << endl ; preprocessUpdate ( 3 , 10 , blk_sz , arr , bit ) ; cout << query ( 3 , 3 , 4 , arr , blk_sz , bit ) << endl ; preprocessUpdate ( 2 , 1 , blk_sz , arr , bit ) ; preprocessUpdate ( 0 , 2 , blk_sz , arr , bit ) ; cout << query ( 0 , 4 , 5 , arr , blk_sz , bit ) << endl ; return 0 ; }