Driver Code
int main ( ) { int arr [ ] = { 18 , 153 , 8 , 9 , 14 , 5 } ; int n = sizeof ( arr ) / sizeof ( arr [ 0 ] ) ; Query q [ ] = { { 0 , 5 , 0 , 0 } , { 3 , 5 , 1 , 0 } } ; int m = sizeof ( q ) / sizeof ( q [ 0 ] ) ; queryResults ( arr , n , q , m ) ; printResults ( q , m ) ; return 0 ; }