#include<stdio.h> #include<string.h> #include<vector> #include<algorithm> using namespace std; vector<int>prime; vector<int>::iterator it1,it; const int N=10100; bool visit[N]; //int prime[N]; int num=0; int init_prim() { memset(visit,true,sizeof(visit)); prime.push_back(0); for(int i=2; i<=N; i++) { if(visit[i]==true) { num++; prime.push_back(i);//从下标1开始存数 } for(int j=1; (j<=num)&&(i*prime[j]<=N); j++) { visit[i*prime[j]]=false; if(i%prime[j]==0)break; } } return 0; } //xiugai int main() { int m,bi; init_prim(); while(scanf("%d",&m)!=EOF) { bi=m/2; //printf("%d\n",bi); it1=lower_bound(prime.begin(),prime.end(),bi);//返回不小于bi的值 //printf("%d\n",*it1); for(it=it1;it!=prime.end();it++) { if(binary_search(prime.begin(), prime.end(), (m-*it)))break; } printf("%d %d\n",m-*it,*it); } return 0; }