-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1092.cpp
More file actions
34 lines (32 loc) · 859 Bytes
/
1092.cpp
File metadata and controls
34 lines (32 loc) · 859 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 4 == 1 || n % 4 == 2) {
cout << "NO\n";
} else if (n % 4 == 3) {
cout << "YES\n";
cout << n / 2 << "\n";
for (int i = 2; i <= n / 2; i += 2) {
cout << i << " " << n - i << " ";
}
cout << n << "\n" << n / 2 + 1 << "\n";
for (int i = 1; i <= n / 2; i += 2) {
cout << i << " " << n - i << " ";
}
} else {
cout << "YES\n";
cout << n / 2 << "\n";
for (int i = 2; i <= n / 2; i += 2) {
cout << i << " " << n - i + 1 << " ";
}
cout << "\n" << n / 2 << "\n";
for (int i = 1; i <= n / 2; i += 2) {
cout << i << " " << n - i + 1 << " ";
}
}
return 0;
}