For the test case

5

2 1 2 2 2

The answer has to be 8 because any contiguous subsequence of the array cannot give the sum to be 8.

So from 1 to 9 there are only 8 possible sums(1 to 7 and 9) and hence the answer has to 8.

But the case is not considered in the test cases and the solution giving 8 or 9 both are getting accepted.

This is clearly unfair.

So either the submissions has to re-evaluated or the contest has to be unrated.