Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ [ 3 , 5 ] , [ 2 , 7 ] , [ 2 , 3 ] , [ 4 , 9 ] ] NEW_LINE queries = [ [ 3 , 4 ] , [ 3 , 2 ] , [ 4 , 1 ] , [ 3 , 7 ] ] NEW_LINE DEDENT