Untitled
user_5668965
c_cpp
a year ago
389 B
19
Indexable
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N=1e6+1;
int v[N],p[N],c,n,A;
signed main()
{
for(int i=2;i<N;i++)
{
if(!v[i])
p[++c]=i;
for(int j=1;i*p[j]<N;j++)
{
v[i*p[j]]=1;
if(i%p[j]==0)
break;
}
}
cin>>n;
while(n>3)
for(int i=2;i<n;i++)
if(!v[i]&&!v[n-i])
n-=2*i,A++,i=n;
cout<<A;
return 0;
}Editor is loading...
Leave a Comment