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
40
41
//============================================================================
// Name        : PA2015_1B_Kieszonkowe.cpp
// Author      : Kornel
// Description : Kieszonkowe
//============================================================================

#include <stdio.h>
using namespace std;

#define NO_WAY "NIESTETY\n"
#define MAX 10001

int min(int num1, int num2) {
	return num1 < num2 ? num1 : num2;
}

int main() {
	int n = 0;
	int a = 0;
	long long total = 0;
	int minOdd = MAX;

	scanf("%d", &n);
	for (int i=0; i<n; i++) {
		scanf("%d", &a);
		total += a;
		if (a % 2 == 1) {
			minOdd = min(minOdd, a);
		}
	}
	if (n == 1 && total % 2 == 1) {
		printf(NO_WAY);
	} else {
		if (total % 2 == 1) {
			printf("%lld\n", (total - minOdd));
		} else {
			printf("%lld\n", (total));
		}
	}
	return 0;
}