Function calls to store maximum and minimum values for respective ranges
prefixArr ( arr , prefix , N ) ; suffixArr ( arr , suffix , N ) ; for ( int i = 0 ; i < q ; i ++ ) { int L = queries [ i ] [ 0 ] ; int R = queries [ i ] [ 1 ] ; maxAndmin ( prefix , suffix , N , L , R ) ; } }