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