cswork / OA打开练习工作台

MathWorksOA #19

Discount Tags

估计中等可在线判题

考点(AI 标注)贪心调度位运算

From tag values that may be positive or negative, choose any number of them (possibly none) so that the sum is even; find the maximum possible even sum. The source guarantees at least one even number.

This site uses a standard input/output protocol.

输入格式

The first line contains n; the second line contains n integers. Constraints added by this site: 1≤n≤100000, |val[i]|≤10^9.

输出格式

Output the maximum even sum.

样例 1

输入:

4
3 2 5 -1

输出:

10

样例 2

输入:

3
4 -2 3

输出:

4

样例 3

输入:

1
0

输出:

0

样例 4

输入:

2
2 -5

输出:

2