Driver Code
public static void main ( String args [ ] ) { int N = 5 ; int [ ] [ ] queries = { { 2 , 1 } , { 1 , 1 } , { 2 , 1 } , { 2 , 3 } } ; int Q = queries . length ; Queries ( queries , N , Q ) ; } }