Function to process queries
def Query ( Q : list , q : int ) : NEW_LINE INDENT for i in range ( q ) : NEW_LINE INDENT print ( BitCount [ Q [ i ] [ 1 ] ] - BitCount [ Q [ i ] [ 0 ] - 1 ] ) NEW_LINE DEDENT DEDENT