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
#include <iostream>
#include <climits>

using namespace std;

int main(int argc, char const *argv[])
{
	int n, suma, min_np, wynik, ile_np;
	int value;

	cin >> n;
	suma = 0;
	min_np = INT_MAX;
	ile_np = 0;


	for (int i = 0; i < n; i++) {
		cin >> value;
		suma += value;
		if (value % 2 == 1) {
			ile_np++;
			if (value < min_np) {
				min_np = value;
			}
		}
	}
	if (ile_np > 0 && ile_np % 2 == 1) {
		wynik = suma - min_np;
	}
	else {
		wynik = suma;
	}
	if (ile_np == 1 && n == 1) {
		cout << "NIESTETY";
	}
	else {
		cout << wynik;
	}
	return 0;
}