Function to perform the queries
def performQueries ( L , R , K , n , q , tree ) : NEW_LINE INDENT for i in range ( q ) : NEW_LINE INDENT print ( query ( tree , 1 , 0 , n - 1 , L [ i ] - 1 , R [ i ] - 1 , K [ i ] ) ) NEW_LINE DEDENT DEDENT