-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRaab-Game-I.cpp
More file actions
49 lines (40 loc) · 848 Bytes
/
Raab-Game-I.cpp
File metadata and controls
49 lines (40 loc) · 848 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
48
49
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
using namespace std;
const int mod = 1e9 +7;
void solve()
{
int n, a, b;
cin>>n>>a>>b;
//if(b>a) swap(a,b);
if((a+b > n)||(a==0 && b!=0)||(b==0 && a!=0))
{
cout<<"NO"<<endl;
return;
}
cout<<"YES"<<endl;
for(int i=0; i<a+b; i++) cout<<i+1<<" ";
for(int i=a+b; i<n ; i++) cout<<i+1<<" ";
cout<<endl;
//if(b<a)
//for(int i=b; i<(a+b+b); i++) cout<<((i)%(a+b))+1<<" ";
//else
for(int i=a; i<(a+b+a); i++) cout<<((i)%(a+b))+1<<" ";
for(int i=a+b; i<n ; i++) cout<<i+1<<" ";
cout<<endl;
}
int main()
{
ios::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
//input test cases
int t;
cin>>t;
while(t--)
{
solve();
}
return 0;
}