-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path27468_adhoc.cpp
36 lines (36 loc) · 904 Bytes
/
27468_adhoc.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
34
35
36
// 27468 2배 또는 0.5배 Gold V
// adhoc
#include <bits/stdc++.h>
#define sz(v) (int)v.size()
#define int long long
#define all(v) (v).begin(), (v).end()
#define press(v) (v).erase(unique(all(v)), (v).end())
using namespace std;
typedef pair<int, int> pi;
typedef pair<int,pi> pii;
const int MAX = 2e6+7;
const int INF = 0x3f3f3f3f3f3f3f3f;
const int MOD = 1e9 + 7;
int N,k1[4]={1,3,2,4},k2[4]={1,2,4,3};
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
cin>>N;
cout<<"YES\n";
if(N%4==2){
for (int i = 0; i < N; ++i) {
for (int j = 0; j < 4; ++j) {
int n=i*4+k2[j];
if(n>N)exit(0);
cout<<n<<" ";
}
}
return 0;
}
for (int i = 0; i < N; ++i) {
for (int j = 0; j < 4; ++j) {
int n=i*4+k1[j];
if(n>N)exit(0);
cout<<n<<" ";
}
}
}