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
36
37
38
39
#include <cstdio>
#include <cstdlib>
#include <algorithm>

using namespace std;

const int A_MAX = 1000;

int main() {
	int n;
	scanf("%d", &n);
	int result = 0, result_odd = 0;
	int odd_count = 0;
	int min_odd = A_MAX + 1;

	for (int i = 0; i < n; ++i) {
		int a;
		scanf("%d", &a);
		if (a % 2 == 0) {
			result += a;
		} else {
			min_odd = min(min_odd, a);
			++odd_count;
			result_odd += a;
		}
	}

	if (odd_count % 2 == 0) {
		result += result_odd;
	} else {
		result += result_odd - min_odd;
	}

	if (result > 0)
		printf("%d\n", result);
	else
		printf("NIESTETY\n");
	return 0;
}