#include<iostream>
using namespace std;
long long int a,b,c=1000000001,d;
int main(){
ios_base::sync_with_stdio(0);
cin>>a;
for(int i=0; i<a; i++){
cin>>b;
if(b%2==1)c=min(b,c);
d+=b;
}
if(a==1 && b%2==1){
cout<<"NIESTETY";
return 0;
}
if(d%2==0)cout<<d;
else cout<<d-c;
return 0;
}
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | #include<iostream> using namespace std; long long int a,b,c=1000000001,d; int main(){ ios_base::sync_with_stdio(0); cin>>a; for(int i=0; i<a; i++){ cin>>b; if(b%2==1)c=min(b,c); d+=b; } if(a==1 && b%2==1){ cout<<"NIESTETY"; return 0; } if(d%2==0)cout<<d; else cout<<d-c; return 0; } |
English