In this problem, we will say that a (sub)sequence of integer numbers is curious if it does not have two consecutive numbers whose sum is even. Given a sequence of integer numbers, what is the maximum sum of elements of all its curious subsequences?
For instance, for 8 10 101 100 120 the maximum sum is 231, corresponding to 10 101 120.
Input consists of several cases, each one with followed by integer numbers between and . Assume .
Print the maximum possible sum for every case.
Author: Salvador Roura
Generation: 2026-01-25T11:56:24.260Z
© Jutge.org, 2006–2026.
https://jutge.org