Driver Code
public static void main ( String [ ] args ) { int arr [ ] = { 18 , 153 , 8 , 9 , 14 , 5 } ; int n = arr . length ; Query q [ ] = new Query [ 2 ] ; q [ 0 ] = new Query ( 0 , 5 , 0 , 0 ) ; q [ 1 ] = new Query ( 3 , 5 , 1 , 0 ) ; int m = q . length ; queryResults ( arr , n , q , m ) ; printResults ( q , m ) ; } }