Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- #define ll unsigned long long
- using namespace std;
- signed main() {
- int n;
- cin >> n;
- vector <bool> arr(n + 1, true);
- for (int i = 2; i * i <= n; ++i) {
- if (!arr[i]) {
- for (int j = i * i; j <= n; ++j)
- arr[j] = false;
- }
- }
- for (int i = 1; i < n / 2 + 2; ++i) {
- if (arr[i] && arr[n - i]) {
- cout << i << ' ' << n - i;
- return 0;
- }
- }
- cout << -1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement