ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2049B - pspspsps
Language: C++20 (GCC 13-64)


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

void solve() {
	int n; cin >> n;
	string s; cin >> s;
	int mx = -1, cnt = 0;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'p') {
			int x = 1, y = i + 1;
			cnt++;
			if (mx > y) {
				cout << "NO\n";
				return;
			}
			mx = max(mx, y);
		}
		else if (s[i] == 's') {
			int x = n - i, y = n;
			if (mx > y or cnt) {
				cout << "NO\n";
				return;
			}
			mx = n;
		}
	}
	cout << "YES\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int tt = 1;
	cin >> tt;
	while (tt--) {
		solve();
	}
}
Problem: 2049B - pspspsps
Language: C++20 (GCC 13-64)

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

void solve() {
	int n; cin >> n;
	string s; cin >> s;
	int mx = -1, cnt = 0, mn = n;
	for (int i = 0; i < n; i++) {
		if (s[i] == 'p') {
			int x = 1, y = i + 1;
			cnt++;
			if (mx > y or x > mn) {
				cout << "NO\n";
				return;
			}
			mn = min(mn, x);
			mx = max(mx, y);
		}
		else if (s[i] == 's') {
			int x = n - i, y = n;
			if (mx > y or cnt or x > mn) {
				cout << "NO\n";
				return;
			}
			mn = min(mn, x);
			mx = n;
		}
	}
	cout << "YES\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int tt = 1;
	cin >> tt;
	while (tt--) {
		solve();
	}
}

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

void solve() {
	int n; cin >> n;
	string s; cin >> s;
	if (n == 1) {
		cout << "YES\n";
		return;
	}
	int mx = -1, cnt = 0, mn = n;
	for (char c : s) {
		if (c == 'p') cnt++;
		else if (c == 's') {
			if (cnt) {
				cout << "NO\n";
				return;
			}
		}
	}
	for (int i = 1; i < n - 1; i++) {
		if (s[i] == 'p') {
			int x = 1, y = i + 1;
			if (mx > y or x > mn) {
				cout << "NO\n";
				return;
			}
			mn = min(mn, x);
			mx = max(mx, y);
		}
		else if (s[i] == 's') {
			int x = n - i, y = n;
			if (mx > y or x > mn) {
				cout << "NO\n";
				return;
			}
			mn = min(mn, x);
			mx = n;
		}
	}
	cout << "YES\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	int tt = 1;
	cin >> tt;
	while (tt--) {
		solve();
	}
}
Problem: 2063C - Remove Exactly Two
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define nl '\n'
#define all(a) a.begin(), a.end()
#define alli(a, r) a.begin() + r, a.end()
#define allr(a) a.rbegin(), a.rend()
const ll N = 2e5 + 7, MOD = 1e9 + 7, INF = 1e9, LG = 18;

int n, m;

struct DSU {

private:
    vector<ll> parents, sizes;
public:
    ll sz, numberOfComponent;
    void init(int szz) {
        sz = szz;
        numberOfComponent = szz;
        parents.resize(sz + 1);
        sizes.resize(sz + 1);

        for (int i = 0; i <= sz; i++) {
            parents[i] = i;
            sizes[i] = 1;

        }
    }

    int find_root(int x) {
        if (parents[x] == x) {
            return x;
        }
        return parents[x] = find_root(parents[x]);
    }

    bool same_set(int i, int j) {
        int x = find_root(i);
        int y = find_root(j);
        return x == y;
    }

    bool merge(int u, int v) {
        int root_u = find_root(u);
        int root_v = find_root(v);
        if (root_u == root_v)
            return false;
        if (sizes[root_u] > sizes[root_v])
            swap(root_u, root_v);
        parents[root_u] = root_v;
        sizes[root_v] += sizes[root_u];
        numberOfComponent--;
        return true;
    }

    void setparent(int i, int j) {
        parents[i] = j;
    }


};

void sol(int tc) {

    cin>>n;
    vector<int>adj[n+1];
    set<pair<int,int>>edges;
    for(int i = 0 ;i<n-1;i++)
    {
        int u,v;
        cin>>u>>v;
       adj[u].push_back(v);
       adj[v].push_back(u);
       edges.insert({min(u,v),max(u,v)});
    }
    multiset<pair<int,int>,greater<>>ms;
    for(int i =1;i<=n;i++)
    {
        ms.insert({adj[i].size(),i});
    }
    int x = ms.begin()->second;
    int y ;
    ms.erase(ms.begin());
    while(!ms.empty())
    {
        auto it =*ms.begin();
        ms.erase(ms.begin());
        pair<int,int> check = {min(x,it.second),max(x,it.second)};
        auto it2 = edges.find(check);
        if(it2==edges.end())
        {
            y = it.second;
            break;
        }
        ms.insert({adj[it.second].size()-1,it.second});
        edges.erase(it2);
    }

    DSU dsu;
    dsu.init(n);
    for(auto&i:edges)
    {
        auto[u,v] = i;
        if (u != x && u != y && v != x  && v != y) {
            dsu.merge(u, v);
        }
    }

    cout<<dsu.numberOfComponent-2;

}

void file() {
#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
#endif
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    // file();

    int tests = 1;
    cin >> tests;
    for (int tes = 1; tes <= tests; ++tes) {

        sol(tes);
        cout<<nl;

    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3


Submission (verdict: Wrong answer on test 1):

import sys,random,bisect,math
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

for _ in range(int(input())):
    l,r=mi()
    a=-1
    for i in range(31):
        if(1<<i >r):
            a=i
            break
    
    num=1<<i
    
    if(num>l and num<=r):
        # if(num==r):
        #     out=[num,num-1,num-2]
        # elif(num==l+1):
        #     out=[l,l+1,l+2]
        if(num==l+1):
            out=[l,l+1,l+2]
        else:
            out=[num,num-1,num-2]
    else:
        out=[r,r-1,r-2]
    print(*out)
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3

Previous submission (verdict: Wrong answer on test 1):

import sys,random,bisect,math
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

for _ in range(int(input())):
    l,r=mi()
    a=-1
    for i in range(31):
        if(1<<i >r):
            a=i
            break
    
    num=1<<(a-1)
    
    if(num>l and num<=r):
        # if(num==r):
        #     out=[num,num-1,num-2]
        # elif(num==l+1):
        #     out=[l,l+1,l+2]
        if(num==l+1):
            out=[l,l+1,l+2]
        else:
            out=[num,num-1,num-2]
    else:
        out=[r,r-1,r-2]
    print(*out)

    
        




Submission (verdict: Accepted):

import sys,random,bisect,math
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

for _ in range(int(input())):
    l,r=mi()
    a=-1
    for i in range(31):
        if(1<<i >r):
            a=i
            break
    
    num=1<<(a-1)
    rbin=bin(r)[2:]



    # i=a-2
    # while(num-1<l or num-1>r):
    #     num+=(1<<i)
    #     i-=1
    # print(num-1,num,num+1)
    num=0
    o=0
    for i in range(len(rbin)):
        if(rbin[i]=="1"):
            num+=(1<<(len(rbin)-i-1))
        
        if(num-1>=l and num!=r):
            o=1
            break

        elif(num-2>=l):
            o=2
            break
    
    if(o==1):
        out=[num-1,num,num+1]
    else:
        out=[num-2,num-1,num]
    print(*out)
Problem: 2057C - Trip to the Olympiad
Language: PyPy 3

Previous submission (verdict: Wrong answer on test 1):

import sys,random,bisect,math
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

for _ in range(int(input())):
    l,r=mi()
    a=-1
    for i in range(31):
        if(1<<i >r):
            a=i
            break
    
    num=1<<i
    
    if(num>l and num<=r):
        # if(num==r):
        #     out=[num,num-1,num-2]
        # elif(num==l+1):
        #     out=[l,l+1,l+2]
        if(num==l+1):
            out=[l,l+1,l+2]
        else:
            out=[num,num-1,num-2]
    else:
        out=[r,r-1,r-2]
    print(*out)

    
        




Submission (verdict: Wrong answer on test 1):

import sys,random,bisect,math
from collections import deque,defaultdict
from heapq import heapify,heappop,heappush
from itertools import permutations

input = lambda :sys.stdin.readline().rstrip()
mi = lambda :map(int,input().split())
li = lambda :list(mi())

for _ in range(int(input())):
    l,r=mi()
    a=-1
    for i in range(31):
        if(1<<i >r):
            a=i
            break
    
    num=1<<(a-1)
    
    if(num>l and num<=r):
        # if(num==r):
        #     out=[num,num-1,num-2]
        # elif(num==l+1):
        #     out=[l,l+1,l+2]
        if(num==l+1):
            out=[l,l+1,l+2]
        else:
            out=[num,num-1,num-2]
    else:
        out=[r,r-1,r-2]
    print(*out)
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<int> a(n);
        int s = 0;
        for (int &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        int ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1])});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<ll> a(n);
        ll s = 0;
        for (ll &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        ll ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1])});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<ll> a(n);
        ll s = 0;
        for (ll &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        ll ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1])});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<ll> a(n);
        ll s = 0;
        for (ll &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        ll ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            s = 0;
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
                s += a[i];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1]), s});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<int> a(n);
        int s = 0;
        for (int &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        int ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1])});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<ll> a(n);
        ll s = 0;
        for (ll &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        ll ans = max({s, a[0], a[n - 1]});
        int num = 1;
        while (num < n) {
            s = 0;
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
                s += a[i];
            }
            ans = max({ans, abs(a[num]), abs(a[n - 1]), s});
            num++;
        }
        cout << ans << "\n";
    }
    return 0;
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int t, n;
    cin >> t;
    while (t--) {
        cin >> n;
        vector<ll> a(n);
        ll s = 0;
        for (ll &tmp : a) {
            cin >> tmp;
            s += tmp;
        }
        ll ans = s;
        for (int num = 1; num < n; num++) {
            s = 0;
            for (int i = n - 1; i >= num; i--) {
                a[i] -= a[i - 1];
                s += a[i];
            }
            ans = max(ans, abs(s));
        }
        cout << ans << "\n";
    }
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>

using namespace std;



int main() {

    int t;

    cin >> t;



    while (t--) 

    {

     

     int n,l,r;

     cin>>n>>l>>r;

     vector<int>arr;

     for(int i=0;i<n;i++)

     {

      int x;

      cin>>x;

      arr.push_back(x);

     }



     vector<int>left;

     for(int i=0;i<l-1;i++)

     {

      left.push_back(arr[i]);

     }

     vector<int>right;

     for(int i=r;i<n;i++)

     {

      right.push_back(arr[i]);

     }

     vector<int>v;

     for(int i=l-1;i<r;i++)

     {

      v.push_back(arr[i]);

     }



     sort(v.begin(),v.end());

     sort(left.begin(),left.end());

     sort(right.begin(),right.end());



     int sum=accumulate(v.begin(),v.end(),0);

     int lsum=sum;

     int j=0;

     for(int i=v.size()-1;i>=0;i--)

     {

         if(j==left.size())

         break;

           if(left[j]<v[i])

           {

              lsum=lsum-v[i]+left[j];

              

           }

           j++;

     }

     int rsum=sum;

     j=0;

     for(int i=v.size()-1;i>=0;i--)

     {

         if(j==right.size())

         break;

         //cout<<right[j]<<" "<<v[i]<<endl;

           if(right[j]<v[i])

           {

              rsum=rsum-v[i]+right[j];

              

           }

        // cout<<rsum<<endl;

           j++;

     }

    /* for(int i:left)

     cout<<i<<" ";

     cout<<endl;

     for(int i:right)

     cout<<i<<" ";

     cout<<endl;

     cout<<lsum<<" "<<rsum<<endl;*/



     cout<<min(rsum,lsum)<<endl;









    

     }



    

}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

using namespace std;



void InOutFast() {

    ios::sync_with_stdio(false);

    cout.tie(nullptr);

    cin.tie(nullptr);

}

#define bye return 0

#define int long long

#define all(a) ((a).begin()), ((a).end())

const int N = 2e5 + 5;



int32_t main() {

    InOutFast();

    int t;

    cin >> t;

    while(t--) {

        string s;

        cin >> s;

        int c = 0, two = 0, three = 0;

        for(auto i : s) {

            c += (i - '0');

            two += (i == '2');

            three += (i == '3');

        }



        if(c%9 == 0)

            cout << "YES\n";

        else{

            bool ok = true;

            int need = 9 - (c%9);

            if(need == 1){

                if(two >= 5 or (three > 1 and two >= 2)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 2){

                if(two > 0){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 4){

                if(two > 1){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 8){

                if(two > 3){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 3){

                if(three > 1 or (two >= 6)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 5){

                if(two >= 7 or (three >= 2 and two >= 1)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 6){

                if(three > 0 or (two > 3)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            else if(need == 7){

                if(two >= 8 or (three >= 2 and two >= 2) or (three >= 1 and two >= 5)){

                    cout << "YES\n";

                    ok = false;

                }

            }

            if(ok)

                cout << "NO\n";

        }

    }

    bye;

}
Problem: 2049C - MEX Cycle
Language: C++23 (GCC 14-64, msys2)

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



using namespace std;



template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef LOCAL

#define dbg(...) cerr << 

 << #__VA_ARGS__ << 

#else

#define dbg(...)

#endif



#define vi vector<int>

#define int long long

#define ld long double

#define sza(x) ((int)x.size())

#define all(a) (a).begin(), (a).end()



const int MAX_N = 1e5 + 5;

const int MOD = 1e9 + 7;

const int INF = 1e9;

const ld EPS = 1e-9;







void solve() {

        int n , x , y;

        cin >> n >> x >> y;

        x-- , y--;



        vi a(n , -1);

        

        for(int i=0;i<n;i++) a[(x + i) % n] = i % 2;



        if(n & 1 or (x - y) & 1) a[x] = 2;



        for(auto &i : a) cout << i << " ";

        cout << endl;

}

signed main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

  int tc = 1;

  cin >> tc;

  for (int t = 1; t <= tc; t++) {

      solve();

  }

}

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



using namespace std;



template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef LOCAL

#define dbg(...) cerr << 

 << #__VA_ARGS__ << 

#else

#define dbg(...)

#endif



#define vi vector<int>

#define int long long

#define ld long double

#define sza(x) ((int)x.size())

#define all(a) (a).begin(), (a).end()



const int MAX_N = 1e5 + 5;

const int MOD = 1e9 + 7;

const int INF = 1e9;

const ld EPS = 1e-9;







void solve() {

        int n , x , y;

        cin >> n >> x >> y;

        x-- , y--;



        vi a(n , -1);

        

        for(int i=0;i<n;i++) a[(x + i) % n] = i % 2;



        if(n & 1 or (x - y) % 2 == 0) a[x] = 2;



        for(auto &i : a) cout << i << " ";

        cout << endl;

}

signed main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

  int tc = 1;

  cin >> tc;

  for (int t = 1; t <= tc; t++) {

      solve();

  }

}
Problem: 2049C - MEX Cycle
Language: C++23 (GCC 14-64, msys2)

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



using namespace std;



template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef LOCAL

#define dbg(...) cerr << 

 << #__VA_ARGS__ << 

#else

#define dbg(...)

#endif



#define vi vector<int>

#define int long long

#define ld long double

#define sza(x) ((int)x.size())

#define all(a) (a).begin(), (a).end()



const int MAX_N = 1e5 + 5;

const int MOD = 1e9 + 7;

const int INF = 1e9;

const ld EPS = 1e-9;







void solve() {

        int n , x , y;

        cin >> n >> x >> y;

        x-- , y--;



        vi a(n , -1);





        if(n % 2 == 0) {

                bool f = true;

                for(int i=x;i<n;i++) {

                        if(f)

                                a[i] = 1;

                        else a[i] = 0;

                        f = !f;

                }

                f = false;

                for(int i=x-1;i>=0;i--) {

                        if(f) a[i] = 0;

                        else a[i] = 1;

                        f = !f;

                }



                for(auto &i : a) cout << i << " ";

                cout << endl;

                return ;

        }



        

        a[x] = 2;

        a[y] = 1;

        bool f = true;

        for(int i=x+1;i<n;i++) {

                if(i == y) {

                        f = false;

                        continue;

                }

                if(f) a[i] = 0;

                else a[i] = 1;

                f = !f;

        }

        for(int i=x-1;i>=0;i--) {

                if(i == y) {

                        f = false;

                        continue;

                }

                if(f) a[i] = 1;

                else a[i] = 0;

                f = !f;

        }



        for(auto &i : a) cout << i << " ";

        cout << endl;

}

signed main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

  int tc = 1;

  cin >> tc;

  for (int t = 1; t <= tc; t++) {

      solve();

  }

}

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



using namespace std;



template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }

#ifdef LOCAL

#define dbg(...) cerr << 

 << #__VA_ARGS__ << 

#else

#define dbg(...)

#endif



#define vi vector<int>

#define int long long

#define ld long double

#define sza(x) ((int)x.size())

#define all(a) (a).begin(), (a).end()



const int MAX_N = 1e5 + 5;

const int MOD = 1e9 + 7;

const int INF = 1e9;

const ld EPS = 1e-9;







void solve() {

        int n , x , y;

        cin >> n >> x >> y;

        x-- , y--;



        vi a(n , -1);

        

        for(int i=0;i<n;i++) a[(x + i) % n] = i % 2;



        if(n & 1 or (x - y) & 1) a[x] = 2;



        for(auto &i : a) cout << i << " ";

        cout << endl;

}

signed main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

  int tc = 1;

  cin >> tc;

  for (int t = 1; t <= tc; t++) {

      solve();

  }

}