Driver Code
int main ( ) { int A [ ] = { 5 , 7 , 2 , 3 , 1 } ; int N = sizeof ( A ) / sizeof ( int ) ; int Q = 3 ; int query [ Q ] [ 3 ] = { { 1 , 1 , 3 } , { 2 , 2 , 5 } , { 1 , 2 , 5 } } ; solveQueries ( A , N , Q , query ) ; return 0 ; }