WA in Maximise the Sum(NOMATCH)

Problem

My Code

What is wrong with my code, it shows WA.
I believe my code is right.

See the range of elements in array take long long instead of int

Thanks @srinivas1999

Thanks srinivas1999 it was my problem too!