n + 1 is taken for simplicity in loops Array will be indexed starting from 1
int marksarr [ n + 1 ] = { 0 , 6 , 4 , 2 , 8 } ; int timearr [ n + 1 ] = { 0 , 4 , 6 , 2 , 7 } ; cout << MaximumMarks ( marksarr , timearr , h , n , p ) ; return 0 ; }