Doubt regarding runtime error in atcoder question

Problem link - https://atcoder.jp/contests/abc166/tasks/abc166_e

My submission - https://atcoder.jp/contests/abc166/submissions/13411813

I do not know why am I getting ‘Runtime Error’ on 2 test cases

@yuvi2701 just make the size of vector h as n+1 instead of n @yuvi2701
i hope your doubt is clear if yes dont forget to mark it as resolved :smiley: