-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPermutations.cpp
More file actions
47 lines (37 loc) · 803 Bytes
/
Copy pathPermutations.cpp
File metadata and controls
47 lines (37 loc) · 803 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
35
36
37
38
39
40
41
42
43
44
45
46
47
#include <bits/stdc++.h>
#define int long long
#define ln "\n"
#define fastio ios_base::sync_with_stdio(0); cin.tie(nullptr)
#define mod 1e9 + 7
#define rep(i, n) for (long long i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << " = " << x << endl;
using namespace std;
void solve()
{
int n;
cin>>n;
if(n==1){
cout << 1;
return;
}
if(n<=3){
cout << "NO SOLUTION";
return;
}
for(int i=2; i<=n; i+=2){
cout << i << " ";
}
for(int i=1; i<=n; i+=2){
cout << i << " ";
}
}
int32_t main()
{
// fastio;
int t=1;
// cin>>t;
while (t--)
solve();
return 0;
}