1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include <iostream>
#include <climits>
#include <algorithm>

int main(int argc, char *argv[]) {
    char fail_message[] = "NIESTETY";
    unsigned long long sum = 0;
    unsigned long long nodd = 0;
    unsigned long long neven = 0;
    unsigned long long mineven = ULLONG_MAX;

    unsigned long long ns;
    std::cin >> ns;

    unsigned long long n;
    while (ns--) {
        std::cin >> n;
        if (n % 2 == 0)
            ++neven;
        else {
            ++nodd;
            mineven = std::min(mineven, n);
        }
        sum += n;
    }
    if (neven > 0 || nodd > 2) {
        if (sum % 2 == 1) {
            sum -= mineven;
        } 
        std::cout << sum << std::endl;
    } else {
        std::cout << fail_message << std::endl;
    }
    return 0;
}