include iostream include iomanip include cstdio include cstring includ

 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
48
49
50
51
52
53
54
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <queue>
#include <ctime>
#include <set>
#include <map>
#include <deque>
using namespace std;
typedef long long ll;
typedef long double ld;
#define forn(i, n) for (int i = 0; i < (n); ++i)
#define PATH "D:\\QtProjects\\olymp\\"
template <class T> void mx(T& a, const T& b) { if (a < b) a = b; }
template <class T> void mn(T& a, const T& b) { if (a > b) a = b; }
template <class T> int sz(const T& a) { return (int)a.size(); }
const int N = 110;
int dp[N][N];
const int inf = 1e9;
int a[N][N];
int main(){
//freopen(PATH"input.txt", "r", stdin);
ios_base::sync_with_stdio(false);
int TT;
cin >> TT;
forn(tttttt, TT){
int n, a, b;
cin >> n >> a >> b;
if (b < a || a >= n || b >= n || (b != 0 && a == 0)) {
cout << "IMPOSSIBLE" << endl;
continue;
}
int i = 1;
for (; a > 1; ++i){
cout << 1 << ' ' << i + 1 << endl;
--b; --a;
}
cout << b;
forn(j, b) cout << ' '<< i + 1 + j;
cout << endl;
++i;
for (; i <= n; ++i)
cout << 0 << endl;
}
return 0;
}