Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT arr = [ 3 , 1 , 23 , 45 , 100 ] NEW_LINE N = len ( arr ) NEW_LINE Q = [ [ 1 , 2 ] , [ 0 , 10 ] , [ 2 , 3 ] , [ 1 , 5 ] , [ 2 , 4 ] ] NEW_LINE Query ( arr , N , Q ) NEW_LINE DEDENT