querying the bit array
static int query ( int idx , int bit [ ] , int n ) { int sum = 0 ; for ( ; idx > 0 ; idx -= idx & - idx ) sum += bit [ idx ] ; return sum ; } static void answeringQueries ( int [ ] arr , int n , Query [ ] queries , int q ) {