ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <complex>
#include <string> 
#include <cstring>
#include <sstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <utility>
#include <set>
#include <queue>
#include <bitset>
#include <list>
#include <tuple>
#include <random>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;

const int modn = 1000000007;
const int maxn = 2e6;
const long double eps = 1e-8;

struct node {
	int x, y, z;
};

int _;
int n, m;
vector<int>a;
ll deg[maxn];

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> _;
	while (_--) {
		cin >> n;
		for (int i = 1;i <= n;++i) {
			deg[i] = 0;
		}
		for (int i = 1, u, v;i < n;++i) {
			cin >> u >> v;
			deg[u] += 1;
			deg[v] += 1;
		}
		ll ans = 1;
		ll p1 = 0, p2 = 0;
		for (int i = 1;i <= n;++i) {
			if (p1 <= deg[i]) {
				if (p2 <= deg[i]) {
					p1 = p2;
					p2 = deg[i];
				}
				else {
					p1 = deg[i];
				}
			}
		}
		if (p1 == 1) {
			p1 -= 1;
		}
		cout << ans + p2 + p1 - 2 << '\n';
	}
	return 0;
}

Submission (verdict: Wrong answer on test 2):
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <complex>
#include <string> 
#include <cstring>
#include <sstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <utility>
#include <set>
#include <queue>
#include <bitset>
#include <list>
#include <tuple>
#include <random>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;

const int modn = 1000000007;
const int maxn = 2e6;
const long double eps = 1e-8;

struct node {
	int x, y, z;
};

int _;
int n, m;
vector<int>a;
ll deg[maxn];
vector<int>g[maxn];

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> _;
	while (_--) {
		cin >> n;
		for (int i = 1;i <= n;++i) {
			deg[i] = 0;
		}
		for (int i = 1, u, v;i < n;++i) {
			cin >> u >> v;
			g[u].push_back(v);
			g[v].push_back(u);
			deg[u] += 1;
			deg[v] += 1;
		}
		ll ans = 1;
		ll ma = 0, mp = 0;
		for (int i = 1;i <= n;++i) {
			if (deg[i] > ma) {
				ma = deg[i];
				mp = i;
			}
		}
		if (ma == 1) {
			cout << 0 << '\n';
			continue;
		}
		ans += ma - 1;
		for (auto x : g[mp]) {
			deg[x] -= 1;
		}
		deg[mp] = 0;
		ma = 0, mp = 0;
		for (int i = 1;i <= n;++i) {
			if (deg[i] > ma) {
				ma = deg[i];
				mp = i;
			}
		}
		ans += ma - 1;
		cout << ans << '\n';
	}
	return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <complex>
#include <string> 
#include <cstring>
#include <sstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <utility>
#include <set>
#include <queue>
#include <bitset>
#include <list>
#include <tuple>
#include <random>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;

const int modn = 1000000007;
const int maxn = 2e6;
const long double eps = 1e-8;

struct node {
	int x, y, z;
};

int _;
int n, m;
vector<int>a;
ll deg[maxn];

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> _;
	while (_--) {
		cin >> n;
		for (int i = 1;i <= n;++i) {
			deg[i] = 0;
		}
		for (int i = 1, u, v;i < n;++i) {
			cin >> u >> v;
			deg[u] += 1;
			deg[v] += 1;
		}
		ll ans = 1;
		ll p1 = 0, p2 = 0;
		for (int i = 1;i <= n;++i) {
			if (p1 <= deg[i]) {
				if (p2 <= deg[i]) {
					p1 = p2;
					p2 = deg[i];
				}
				else {
					p1 = deg[i];
				}
			}
		}
		if (p1 == 1) {
			p1 -= 1;
		}
		cout << ans + p2 + p1 - 2 << '\n';
	}
	return 0;
}
Problem: 2049B - pspspsps
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

    

  

  if "s" in c and "p" in c:

    if c[-1] != "p":

      print("No")

      

    elif k == -1:

      print("No")

      

    else:

      print("Yes")

      

  elif k == -1:

    print("No")

    

  else:

    print("Yes")

Submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      print("Yes")

        

  elif k == -1:

    print("No")
Problem: 2049B - pspspsps
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      s = 0

      p = 0

      l = 0

      for y in range(b):

        if c[y] == ".":

          if (s > 1 and p > 0) or (s > 0 and p > 1):

            l = -1

            break

          

          s = 0

          p = 0

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

          

        

      s = 0

      p = 0

      for y in range(b-1,-1,-1):

        if c[y] == ".":

          if (s > 1 and p > 0) or (s > 0 and p > 1):

            l = -1

            break 

          

          s = 0

          p = 0

          

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

              

              

           

      if l == -1:

        print("No")

        

      else:

        print("Yes")

          

      

  

  elif k == -1:

    print("No")



Submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      s = 0

      p = 0

      l = 0

      for y in range(b):

        if c[y] == ".":

          if (s > 1 and p > 0):

            l = -1

            break

          

          s = 0

          p = 0

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

          

        

      s = 0

      p = 0

      for y in range(b-1,-1,-1):

        if c[y] == ".":

          if (p > 1 and s > 0):

            l = -1

            break 

          

          s = 0

          p = 0

          

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

              

              

           

      if l == -1:

        print("No")

        

      else:

        print("Yes")

          

      

  

  elif k == -1:

    print("No")
Problem: 2049B - pspspsps
Language: PyPy 3-64


Submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

    

  

  if "s" in c and "p" in c:

    if c[-1] != "p":

      print("No")

      

    elif k == -1:

      print("No")

      

    else:

      print("Yes")

      

  elif k == -1:

    print("No")

    

  else:

    print("Yes")
Problem: 2049B - pspspsps
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      print("Yes")

        

  elif k == -1:

    print("No")

    

      

Submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      s = 0

      p = 0

      l = 0

      for y in range(b):

        if c[y] == ".":

          if (s > 1 and p > 0) or (s > 0 and p > 1):

            l = -1

            break

          

          s = 0

          p = 0

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

          

        

      s = 0

      p = 0

      for y in range(b-1,-1,-1):

        if c[y] == ".":

          if (s > 1 and p > 0) or (s > 0 and p > 1):

            l = -1

            break 

          

          s = 0

          p = 0

          

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

              

              

           

      if l == -1:

        print("No")

        

      else:

        print("Yes")

          

      

  

  elif k == -1:

    print("No")
Problem: 2049B - pspspsps
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 2):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  k = 0

  for z in range(b):

    if c[z] == "p" and k == 0:

      k = 1

      

    elif k == 1 and c[z] == "s":

      k = -1

      break

    

  if k != -1:

    n = c[0]

    for y in range(1,b):

      if c[y-1] != c[y]:

        n += c[y]

        

        

    if ".sp." in n:

      print("No")

      

    else:

      s = 0

      p = 0

      l = 0

      for y in range(b):

        if c[y] == ".":

          if (s > 1 and p > 0):

            l = -1

            break

          

          s = 0

          p = 0

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

          

        

      s = 0

      p = 0

      for y in range(b-1,-1,-1):

        if c[y] == ".":

          if (p > 1 and s > 0):

            l = -1

            break 

          

          s = 0

          p = 0

          

        else:

          if c[y] == "s":

            s += 1

              

          else:

            p += 1

              

              

           

      if l == -1:

        print("No")

        

      else:

        print("Yes")

          

      

  

  elif k == -1:

    print("No")

    



Submission (verdict: Accepted):
a = int(input())

for y in range(a):

  b = int(input())

  c = input()

  j = list(c)

  

  if j[0] == "s":

    j[0] = "."

    

  if j[-1] == "p":

    j[-1] = "."

    

  l = 0

  if "s" in j and "p" in j:

    l = -1

    

    

  print("Yes") if l == 0 else print("No")
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;

//JAY SHREE KRISHNA
// --------------------------------------
#define ll long long
#define ld long double
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define pb push_back
#define pp pop_back
#define endl "\n"
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
// -------------------------------------

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t;		cin>>t;
    while(t--){
        long long l,r,req=0;
        cin>>l>>r;
        bool flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req=req|((((r>>i)&1))<<i);
            }
            else if(((l>>i)&1)!=((r>>i)&1)&&!flag){
                req=req|(1<<i);
            }
            else{
                flag=false;
                req=req|((!(((r>>i)&1)))<<i);
            }
        }
        if(req==l){
            cout<<l<<" "<<l+1<<" "<<r<<endl;
        }
        else{
            cout<<l<<" "<<r<<" "<<req<<endl;
        }
    }
    return 0;
}

Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;

//JAY SHREE KRISHNA
// --------------------------------------
#define ll long long
#define ld long double
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define pb push_back
#define pp pop_back
#define endl "\n"
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
// -------------------------------------

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t;		cin>>t;
    while(t--){
        long long l,r,req1=0,req2=0;
        cin>>l>>r;
        bool flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req1=req1|((((r>>i)&1))<<i);
            }
            else if(((l>>i)&1)!=((r>>i)&1)&&!flag){
                req1=req1|(1<<i);
            }
            else{
                flag=false;
                req1=req1|((!(((r>>i)&1)))<<i);
            }
        }
        flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req2=req2|((((r>>i)&1))<<i);
            }
            else if(((l>>i)&1)!=((r>>i)&1)&&!flag){
                req2=req2|(0<<i);
            }
            else{
                flag=false;
                req2=req2|((!(((l>>i)&1)))<<i);
            }
        }
        if(req1<=l){
            cout<<l<<" "<<req2<<" "<<r<<endl;
        }
        else{
            cout<<l<<" "<<req1<<" "<<r<<endl;
        }
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;

//JAY SHREE KRISHNA
// --------------------------------------
#define ll long long
#define ld long double
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define pb push_back
#define pp pop_back
#define endl "\n"
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
// -------------------------------------

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t;		cin>>t;
    while(t--){
        long long l,r,req=0;
        cin>>l>>r;
        bool flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req=req|((((r>>i)&1))<<i);
            }
            else{
                flag=false;
                req=req|((!(((r>>i)&1)))<<i);
            }
        }
        if(req==l){
            cout<<l<<" "<<l+1<<" "<<r<<endl;
        }
        else{
            cout<<l<<" "<<r<<" "<<req<<endl;
        }
    }
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;

//JAY SHREE KRISHNA
// --------------------------------------
#define ll long long
#define ld long double
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define pb push_back
#define pp pop_back
#define endl "\n"
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
// -------------------------------------

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t;		cin>>t;
    while(t--){
        long long l,r,req=0;
        cin>>l>>r;
        bool flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req=req|((((r>>i)&1))<<i);
            }
            else if(((l>>i)&1)!=((r>>i)&1)&&!flag){
                req=req|(1<<i);
            }
            else{
                flag=false;
                req=req|((!(((r>>i)&1)))<<i);
            }
        }
        if(req==l){
            cout<<l<<" "<<l+1<<" "<<r<<endl;
        }
        else{
            cout<<l<<" "<<r<<" "<<req<<endl;
        }
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include<bits/stdc++.h>
using namespace std;

//JAY SHREE KRISHNA
// --------------------------------------
#define ll long long
#define ld long double
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define pb push_back
#define pp pop_back
#define endl "\n"
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
// -------------------------------------

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int t;		cin>>t;
    while(t--){
        long long l,r,req=0;
        cin>>l>>r;
        bool flag=true;
        for(int i=30;i>=0;i--){
            if(((l>>i)&1)==((r>>i)&1)&&flag){
                req=req|((((r>>i)&1))<<i);
            }
            else{
                flag=false;
                req=req|((!(((r>>i)&1)))<<i);
            }
        }
        if(req==l){
            cout<<l<<" "<<l+1<<" "<<r<<endl;
        }
        else{
            cout<<l<<" "<<r<<" "<<req<<endl;
        }
    }
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <memory.h>
#include <cmath>
#include <queue>
#include <algorithm>
#include <sstream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <climits>

using namespace std;

#define pb push_back
#define int long long
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define LOG(n) 31 - __builtin_clz(n)
#define nl  "\n"
#define ok  cout<<"OK\n"
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define free freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)
#define ff first
#define ss second
#define vi vector<int>
#define vvi vector<vector<int> >
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
typedef pair<int,int> pii;
typedef long double ld;
const long long INF = 1ll << 32;
const long long MAX_N = 1e6 + 5;
const long long MOD = 1e9 + 7;
const long long N = 9999999;
long double pi = 3.1415926535;

void show(vector<int> a) {for(auto it : a) cout<<it<<","; cout<<nl;}
int gcd(int a, int b){if(a == 0) return b; if(b == 0) return a;int r = min(a, b);while(r>0){if(a%r==0 && b%r==0){break;}r--;}return r;}

int sq(int n){if(n==0)return 0LL;int l=1,r=n;while(l<=r){int m=l+(r-l)/2;int p=m*m;if(p==n)return m;if(p<n)l=m+1;else r=m-1;}return l;}
int I;


void solve()
{
    int n;
    cin>>n;
    vector<int> c(n);
    for(int &it : c) cin>>it;
    set<int> players;
    set<pair<int , int> > ans;
    for(int i = 0 ; i < n ; i++) {
        for(auto it = players.rbegin() ; it != players.rend() ; it++) {
            int player = *it;
            if(player < c[i]) break;
            if(player > c[i]) {
                ans.insert({player , c[i]});
            }
        }
        players.insert(c[i]);
    }
    for(int i = 1 ; i <= n ; i++) {
        for(int j = i + 1 ; j <= n ; j++) {
            if(ans.find({i , j}) == ans.end() && ans.find({j , i}) == ans.end()) {
                ans.insert({i , j});
                ans.insert({j , i});
            }
        }
    }
    cout<<ans.size()<<endl;
    for(pair<int , int> overtakes : ans) {
        cout<<overtakes.first<<" "<<overtakes.second<<endl;
    }
    
}

int32_t main()
{
    ios;
//    freopen("visitfj.in","r",stdin);
//    freopen("visitfj.out","w",stdout);
    int Test = 1;
//    cin>>Test;
    for(I = 1 ; I <= Test ; I++)
    {
        solve();
    }
 
 
}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include<set>

#include<map>

#include<ctime>

#include<queue>

#include<stack>

#include<cmath>

#include<vector>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<algorithm>



#define int long long



using namespace std;



const int N = 1e6 + 100;

const int MOD = 998244353;

const int INF = 1e18 + 7;



int gi()

{

   int s=0,f=1;char ch=getchar();

   while(!(ch>='0'&&ch<='9')) f=(ch=='-'?-1:1),ch=getchar();

   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();

   return s*f;

}



int PRINT[333];

void print(int x)

{

    if(!x) 

    {

        putchar('0');

        return;

    }

    if(x<0) putchar('-'),x=-x;

    int ppp=0;

    while(x) PRINT[++ppp]=x%10,x/=10;

    for(int i=ppp;i>=1;--i) putchar(PRINT[i]+'0');

}



int T;

int n,m;

int A[N],B[N];

char ch[N];



signed main()

{

    T=gi();

    while(T--)

    {

        n=gi();

        int x=gi(),y=gi();

        if(n&1)

        {

            for(int i=1;i<n;++i) A[i]=i&1;

            A[n]=2;

        }

        else

        {

            for(int i=1;i<=n;++i) A[i]=i&1;

        }

        if(A[x]!=A[y])

        {

            for(int i=1;i<=n;++i) printf("%d ",A[i]);

            putchar('\n');

            continue;

        }

        if(n%2==0)

        {

            A[x]=2;

        }

        else

        {

            if(x==1||x==n-1) A[x]=3;

            else A[x]=2;

        }

        for(int i=1;i<=n;++i) printf("%d ",A[i]);

        putchar('\n');

    }

}

Submission (verdict: Wrong answer on test 2):
#include<set>

#include<map>

#include<ctime>

#include<queue>

#include<stack>

#include<cmath>

#include<vector>

#include<cstdio>

#include<cstdlib>

#include<cstring>

#include<iostream>

#include<algorithm>



#define int long long



using namespace std;



const int N = 1e6 + 100;

const int MOD = 998244353;

const int INF = 1e18 + 7;



int gi()

{

   int s=0,f=1;char ch=getchar();

   while(!(ch>='0'&&ch<='9')) f=(ch=='-'?-1:1),ch=getchar();

   while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();

   return s*f;

}



int PRINT[333];

void print(int x)

{

    if(!x) 

    {

        putchar('0');

        return;

    }

    if(x<0) putchar('-'),x=-x;

    int ppp=0;

    while(x) PRINT[++ppp]=x%10,x/=10;

    for(int i=ppp;i>=1;--i) putchar(PRINT[i]+'0');

}



int T;

int n,m;

int A[N],B[N];

char ch[N];



signed main()

{

    T=gi();

    while(T--)

    {

        n=gi();

        int x=gi(),y=gi();

        if(n&1)

        {

            for(int i=1;i<n;++i) A[i]=i&1;

            A[n]=2;

        }

        else

        {

            for(int i=1;i<=n;++i) A[i]=i&1;

        }

        if(A[x]!=A[y])

        {

            for(int i=1;i<=n;++i) printf("%d ",A[i]);

            putchar('\n');

            continue;

        }

        if(n%2==0)

        {

            A[x]=2;

        }

        else

        {

            if(x==1||x==n-1) A[n]=A[x],A[x]=2;

            else A[x]=2;

        }

        for(int i=1;i<=n;++i) printf("%d ",A[i]);

        putchar('\n');

    }

}