-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1092.cpp
33 lines (31 loc) · 888 Bytes
/
1092.cpp
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
//https://cses.fi/problemset/task/1092
#include <bits/stdc++.h>
using namespace std;
int main()
{
int i, j;
cin >> i;
if (i % 4 == 0) {
cout << "YES" << "\n";
cout << i / 2 << "\n";
for (j = 1; j <= i / 4; j++)
cout << j << " " << i + 1 - j << " ";
cout << "\n" << i / 2 << "\n";
for (j = i / 4 + 1; j <= i / 2; j++)
cout << j << " " << i + 1 - j << " ";
}
else if (i % 4 == 3) {
cout << "YES" << "\n";
cout << i / 2 + 1 << "\n";
cout << 1 << " " << 2 << " ";
for (j = 4; j <= i / 4 + 3; j++)
cout << j << " " << i + 4 - j << " ";
cout << "\n" << i / 2 << "\n";
cout << 3 << " " ;
for (j = i / 4 + 4; j <= i / 2 + 2; j++)
cout << j << " " << i + 4 - j << " ";
}
else
cout << "NO" << "\n";
return 0;
}