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