Run ID:109920
提交时间:2025-02-13 12:14:39
#include<bits/stdc++.h> using namespace std; bool zs(int x) { if(x<2) { return 0; } for(int i=2; i*i<=x; i++) { if(x%i==0) { return 0; } } return 1; } int S; int mx=0; int main() { cin>>S; for(int x=2; x<=S; x++) { if(zs(x)&&zs(S-x)){ if(x*(S-x)>mx){ mx=x*(S-x); } } } cout<<mx; return 0; }