Driver Code
int main ( ) { int N = 5 , Q = 3 ; int * * queries = new int * [ Q ] ; for ( int i = 0 ; i < Q ; i ++ ) { queries [ i ] = new int [ 2 ] ; } queries [ 0 ] [ 0 ] = 1 ; queries [ 0 ] [ 1 ] = 0 ; queries [ 1 ] [ 0 ] = 3 ; queries [ 1 ] [ 1 ] = 3 ; queries [ 2 ] [ 0 ] = 2 ; queries [ 2 ] [ 1 ] = 2 ; solve ( N , Q , queries ) ; return 0 ; }