Driver Code
static public void Main ( ) { int [ ] A = { 5 , 7 , 2 , 3 , 1 } ; int N = A . Length ; int Q = 3 ; int [ ] [ ] query = { new int [ 3 ] { 1 , 1 , 3 } , new int [ 3 ] { 2 , 2 , 5 } , new int [ 3 ] { 1 , 2 , 5 } } ; solveQueries ( A , N , Q , query ) ; } }