Driver Code
int main ( ) { int arr [ ] = { 5 , 6 , 8 , 10 , 15 } ; int N = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; int queries [ ] [ 2 ] = { { 0 , 1 } , { 0 , 2 } , { 1 , 4 } } ; int Q = sizeof ( queries ) / sizeof ( queries [ 0 ] ) ; findMaximum ( arr , N , Q , queries ) ; return 0 ; }