P5990 [PA 2015] Kieszonkowe

Description

Given $n$ numbers, select some of them such that the total sum is even. Maximize this sum.

Input Format

The first line contains a positive integer $n$. The second line contains $n$ positive integers $a_1, a_2, ..., a_n$.

Output Format

Output one positive integer, the maximum possible sum. If there is no solution, output `NIESTETY`.

Explanation/Hint

For $100\%$ of the testdata, $1 \le n \le 10^6$, $1 \le a_i \le 10^3$. Translated by ChatGPT 5