https://ac.nowcoder.com/acm/contest/57357/H
哥德巴赫猜想
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
ll n;
ll sum=0;
cin>>n;
for(int i=1;i<=n;i++){
ll a;
cin>>a;
sum+=a;
}
if(2*n>sum){
cout<<"No";
return 0;
}
if(n==1){
for(ll i=2;i*i<=sum;i++){
if(sum%i==0){
cout<<"No";
return 0;
}
}
cout<<"Yes";
return 0;
}
if(n==2){
if(sum%2==0){
cout<<"Yes";
return 0;
}
else{
sum-=2;
for(ll i=2;i*i<=sum;i++){
if(sum%i==0){
cout<<"No";
return 0;
}
}
cout<<"Yes";
return 0;
}
}
cout<<"Yes";
return 0;
}