If i is equal to r of any query store answer for that query in ans [ ]
while query_counter < q and queries [ query_counter ] . r == i : NEW_LINE INDENT ans [ queries [ query_counter ] . idx ] = query ( queries [ query_counter ] . r + 1 , bit , n ) - query ( queries [ query_counter ] . l , bit , n ) NEW_LINE query_counter += 1 NEW_LINE DEDENT