1
+ // https://codeforces.com/contest/1612/problem/B
2
+ /*
3
+
4
+ ░██████╗██████╗░░█████╗░██████╗░░██████╗██╗░░██╗ ░██████╗░██╗░░░██╗██████╗░████████╗░█████╗░
5
+ ██╔════╝██╔══██╗██╔══██╗██╔══██╗██╔════╝██║░░██║ ██╔════╝░██║░░░██║██╔══██╗╚══██╔══╝██╔══██╗
6
+ ╚█████╗░██████╔╝███████║██████╔╝╚█████╗░███████║ ██║░░██╗░██║░░░██║██████╔╝░░░██║░░░███████║
7
+ ░╚═══██╗██╔═══╝░██╔══██║██╔══██╗░╚═══██╗██╔══██║ ██║░░╚██╗██║░░░██║██╔═══╝░░░░██║░░░██╔══██║
8
+ ██████╔╝██║░░░░░██║░░██║██║░░██║██████╔╝██║░░██║ ╚██████╔╝╚██████╔╝██║░░░░░░░░██║░░░██║░░██║
9
+ ╚═════╝░╚═╝░░░░░╚═╝░░╚═╝╚═╝░░╚═╝╚═════╝░╚═╝░░╚═╝ ░╚═════╝░░╚═════╝░╚═╝░░░░░░░░╚═╝░░░╚═╝░░╚═╝
10
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
11
+ █████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗█████╗
12
+ ╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝╚════╝
13
+ ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
14
+
15
+ */
16
+
17
+ #include < bits/stdc++.h>
18
+
19
+ using namespace std ;
20
+
21
+ #define fi first
22
+ #define se second
23
+ #define pb push_back
24
+ #define mp make_pair
25
+ #define all (x ) x.begin(), x.end()
26
+ #define ll long long
27
+ #define pll pair<ll, ll>
28
+ #define vll vector<long long >
29
+ #define mll map<ll, ll>
30
+ #define inf 1e18
31
+ #define gcd (a, b ) __gcd(a, b)
32
+ #define range (a,b ) substr(a,b-a+1 )
33
+ #define setbits (x ) __builtin_popcountll(x)
34
+ #define zrobits (x ) __builtin_ctzll(x)
35
+ #define fori (a, n ) for (ll i = a; i < n; i++)
36
+ #define forj (a, n ) for (ll j = a; j < n; j++)
37
+ #define fork (a, n ) for (ll k = a; k < n; k++)
38
+ #define print (x ) for (auto i : x) {cout << i << " " ;}
39
+ #define FIO ios_base::sync_with_stdio (0 ); cin.tie(0 ); cout.tie(0 )
40
+ mt19937 rng (chrono::steady_clock::now().time_since_epoch().count());
41
+
42
+ template <class T >
43
+ bool comp (T a, T b) {
44
+ if (a < b)
45
+ return true ;
46
+ return false ;
47
+ }
48
+
49
+ int main ()
50
+ {
51
+ FIO;
52
+
53
+ #ifndef ONLINE_JUDGE
54
+ // remove this piece of code when this has to be submitted in kickstart, coding ninjas
55
+ freopen (" input.txt" , " r" , stdin);
56
+ freopen (" output.txt" , " w" , stdout);
57
+ // freopen is used to associate a file with stdin or stdout stream in C++
58
+ #endif
59
+
60
+ ll t;
61
+ cin >> t;
62
+ while (t--) {
63
+ ll n, a, b;
64
+ cin >> n >> a >> b;
65
+ if ((a <= n / 2 && b <= n / 2 ) || (a > n / 2 && b > n / 2 ))
66
+ cout << -1 << " \n " ;
67
+ else if ((a > (n / 2 ) + 1 ) || (b < (n / 2 )))
68
+ cout << -1 << " \n " ;
69
+ else {
70
+ ll cnt = 1 , t_n = n;
71
+ cout << a << " " ;
72
+ while (cnt < n / 2 ) {
73
+ if (t_n != b && t_n != a) {
74
+ cout << t_n << " " ;
75
+ cnt++;
76
+ }
77
+ t_n--;
78
+ }
79
+ cnt = 1 , t_n = 1 ;
80
+ cout << b << " " ;
81
+ while (cnt < n / 2 ) {
82
+ if (t_n != b && t_n != a) {
83
+ cout << t_n << " " ;
84
+ cnt++;
85
+ }
86
+ t_n++;
87
+ }
88
+ cout << " \n " ;
89
+ }
90
+ }
91
+
92
+ return 0 ;
93
+ }
0 commit comments