Try this input.
1 2 1 5 5 100 100
Your answer gives 100, but 100 should cause 2 negative reviews, which is not allowed.
100
2
Try this input.
Spoiler
Your answer gives
100, but100should cause2negative reviews, which is not allowed.