#P5990. [PA 2015] Kieszonkowe

[PA 2015] Kieszonkowe

Description

Given nn numbers, select some of them such that the total sum is even.

Maximize this sum.

Input Format

The first line contains a positive integer nn.

The second line contains nn positive integers a1,a2,...,ana_1, a_2, ..., a_n.

Output Format

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

5
2 4 3 3 3
12

Hint

For 100%100\% of the testdata, 1n1061 \le n \le 10^6, 1ai1031 \le a_i \le 10^3.

Translated by ChatGPT 5