Run ID:72781

提交时间:2024-05-12 18:08:37

#include<bits/stdc++.h> using namespace std; int prime(int x){ for(int i = 2; i < x; i++){ if(x % i == 0){ return 0; } } return 1; } int main(){ int n; cin >> n; int mx = -2e9; for(int i = 2; i < n-1; i++){ if(prime(i) == 1 && prime(n-i) == 1){ if(i * (n-i) > mx){ mx = i*(n-i); } } } cout << mx; return 0; }