#include <iostream>
#include <stdint.h>
using namespace std;
int main() {
int64_t k=0;
int o=0,n,p=0;
cin >> n ;
for(int i=0; i<n; i++){
cin >> p;
if(p%2 != 0){
if(o==0){o=p;}
else{
if(o>p){o=p;}
}
}
k=k+p;}
if(k%2 == 0){cout << k << '\n';}
else if(k-o>0){cout << k-o << '\n';}
else {cout << "NIESTETY"<< '\n';}
return 0;
}
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 | #include <iostream> #include <stdint.h> using namespace std; int main() { int64_t k=0; int o=0,n,p=0; cin >> n ; for(int i=0; i<n; i++){ cin >> p; if(p%2 != 0){ if(o==0){o=p;} else{ if(o>p){o=p;} } } k=k+p;} if(k%2 == 0){cout << k << '\n';} else if(k-o>0){cout << k-o << '\n';} else {cout << "NIESTETY"<< '\n';} return 0; } |
English