Driver code
int main ( ) { int ar [ ] = { 200 , 100 , 200 , 300 } ; int n = ( sizeof ar ) / ( sizeof ar [ 0 ] ) ; int q = 2 ; int x [ ] = { 2 , 3 } ; int y [ ] = { 100 , 90 } ; max_sum ( ar , n , q , x , y ) ; return 0 ; }