ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2062C - Cirno and Operations
Language: Python 3

Previous submission (verdict: Runtime error on test 1):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
        return n - 1, new_l


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])
    
    if n==2:
        if l[0] >= 0 and l[1] >= 0:
            print(l[0] + l[1])
        else:
            print(abs(l[0] - l[1]))
        

    else:
        while n >2:
            n, l = reduction(n,l)
        print(two(l))

Submission (verdict: Wrong answer on test 6):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
        return n - 1, new_l


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])

    elif n==2:
        if l[0] >= 0 and l[1] >= 0:
            print(l[0] + l[1])
        else:
            print(abs(l[0] - l[1]))


    else:
        while n >2:
            n, l = reduction(n,l)
        print(two(l))
Problem: 2062C - Cirno and Operations
Language: Python 3

Previous submission (verdict: Wrong answer on test 2):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
        return n - 1, new_l


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])

    else:
        while n >2:
            n, l = reduction(n,l)
        print(two(l))

Submission (verdict: Runtime error on test 1):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
        return n - 1, new_l


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])
    
    if n==2:
        if l[0] >= 0 and l[1] >= 0:
            print(l[0] + l[1])
        else:
            print(abs(l[0] - l[1]))
        

    else:
        while n >2:
            n, l = reduction(n,l)
        print(two(l))
Problem: 2062C - Cirno and Operations
Language: Python 3

Previous submission (verdict: Wrong answer on test 6):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
        return n - 1, new_l


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])

    elif n==2:
        if l[0] >= 0 and l[1] >= 0:
            print(l[0] + l[1])
        else:
            print(abs(l[0] - l[1]))


    else:
        while n >2:
            n, l = reduction(n,l)
        print(two(l))

Submission (verdict: Wrong answer on test 6):
for _ in range(int(input())):
    n = int(input())
    l = list(map(int, input().split()))


    def reduction(n, l):
        new_l = []
        summ=0
        for i in range(n - 1):
            new_l.append(l[i + 1] - l[i])
            summ += l[i+1]-l[i]
        return n - 1, new_l, summ


    def two(l):
        if l[0] * l[1] >= 0:
            return abs(l[0] + l[1])
        else:
            return abs(l[0] - l[1])

    if n==1:
        print(l[0])

    elif n==2:
        if l[0] >= 0 and l[1] >= 0:
            print(l[0] + l[1])
        else:
            print(abs(l[0] - l[1]))


    else:
        count =0
        while n >2:
            n, l, summ = reduction(n,l)
            count = max(count, abs(summ))
        print(max(two(l),count))
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)


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

#define pb push_back

#define endl "\n"
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define debug(a) cout<<#a<<' '<<a<<endl;
#define cut cout<<endl <<"-------------------"<<endl;
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;

const int N = 2e5+10;
const ll mod=1e9 + 7, inf = 0x3f3f3f3f;
mt19937 mrand(time(0));     
int rnd(int x) { return mrand() % x;}
ll qmi(ll a,ll b,ll p) {ll res=1;a%=p; assert(b>=0); for(;b;b/=2){if(b&1)res=res*a%p;a=a*a%p;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

void init()
{
    int n;
    cin >> n;
    vector<pii> g;
    vector<int> d(n + 1, 0);
    for(int i = 1; i < n; i ++)
    {
        int l, r;
        cin >> l >> r;
        g.pb({l, r});
        d[l] ++, d[r] ++;
    }
    if(n == 2)
    {
        cout << 0 << endl;
        return;
    }
    int mx = -1, id = -1;
    for(int i = 1; i <= n; i ++)
    {
        if(d[i] > mx)
        mx = d[i], id = i;
    }
    for(int i = 1; i <= n; i ++) d[i] = 0;
    d[id] = -1;
    for(auto [l, r] : g)
    {
        if(l == id || r == id) continue;
        d[l] ++, d[r] ++;
    }
    mx = -1;
    int idd = -1;
    for(int i = 1; i <= n; i ++)
    {
        if(d[i] > mx)
        mx = d[i], idd = i;
    }
    int s = 0;
    // debug(id)
    // debug(idd)
    for(auto [l, r] : g)
    {
        if(l == id || r == id) continue;
        if(l == idd || r == idd) continue;
        // cout << l << ' ' << r << endl;
        s ++;
    }
    // debug(s)
    cout << n - 2 - s << endl;
}

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin.tie(0);
    
    int _;
    cin>>_;
    // _ = 1; 
    while(_--)
    {
        init();
    }

    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file  
#include <ext/pb_ds/tree_policy.hpp>  
#include <functional> // for less 

using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef double long dl;
typedef tree<int, null_type, less<int>, rb_tree_tag,  
            tree_order_statistics_node_update>  
    ordered_set;

ll n,k;
string sa,sb;
vector<ll> a,p;
//vector<vector<ll>> ca;
ll mod = 1e9 + 7;
ll fact[200005];

ll powN(ll x, ll y);
ll getNcR(ll n, ll r);
ll ansSparseQuery(vector<vector<ll>>& sparseTable,int l, int r);
vector<vector<ll>> getSparseTable(vector<ll>& arr);
void initFact();
void initArr(vector<ll>& arr, ll n);

map<char,bool> mp;

bool solve()
{
    if(a[0] > a[1]) return false;
    ll x = 0;
    for(int i = 1; i<n; i++){
        if(a[i] < a[i-1]) x++;
        else x = 0;
        if(x >= 2) return false;
    }
    return true;
} 

int main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt", "r", stdin); 
       freopen("output.txt", "w", stdout); 
    #endif

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll ts;
    cin>>ts;
    //initFact();
    while(ts--)
    {
        cin>>n;
        initArr(a,n);
        //cin>>sa;
        //initArr(p,n-1);
        //initArr(c,n);
        cout<<(solve() ? "YES\n" : "NO\n");
        
        //cout<<solve()<< "\n";
        //solve();
    }
    
    return 0;
}

void initFact(){
    fact[0] = 1;
    for (int i = 1; i < 200005; i++) {
        fact[i] = (fact[i - 1] * i) % mod;
    }
}

void initArr(vector<ll>& arr, ll n){
    arr.clear();
    arr.resize(n);
    for(int i=0;i<n;i++) cin>>arr[i];
}

ll powN(ll x, ll y){
    ll res = 1;     // Initialize result 
 
    x = x % mod; // Update x if it is more than or 
                // equal to p
  
    if (x == 0) return 0; // In case x is divisible by p;
 
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % mod; 
 
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % mod; 
    } 
    return res; 
}

ll getNcR(ll n, ll r)
{
    if(n < r) return 0;
	return (fact[n] * powN((fact[n - r] * fact[r]) % mod, mod - 2)) % mod;
}

ll ansSparseQuery(vector<vector<ll>>& sparseTable,int l, int r)
{
    int j = log2(r-l+1);

    return __gcd(sparseTable[l][j], sparseTable[r - (1<<j) + 1][j]);
}

vector<vector<ll>> getSparseTable(vector<ll>& arr)
{
    ll n = arr.size();
    if(n == 0) return {{}};
    vector<vector<ll>> sparseTable(n,vector<ll>(log2(n)+1));
    for(int i = 0; i<n; i++){
        sparseTable[i][0] = arr[i];
    }

    for(int j = 1; (1<<j) <= n; j++){
        for(int i = 0; i + (1<<j) <= n; i++){
            sparseTable[i][j] = __gcd(sparseTable[i][j-1],sparseTable[i + (1<<(j-1))][j-1]);
        }
    }
    return sparseTable;
}
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;
#define int long long
#define endl '\n'
#define close ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

void solved()
{
    int l, r;
    cin >> l >> r;
    bitset<30> right(r);
    bitset<30> left(l);
    bitset<30> ans;
    set<int>st;
    set<int>t1;
    priority_queue<int>t0;
    int maxNum = 0;
    for(int i = 0;i<30;i++)
    {
        if(right[i] == 1)
        {
            maxNum = i;
        }
    }
    for (int i = 0; i <= maxNum; i++) {
        if (right[i] == 1 && left[i] == 1) {
            ans[i] = 0;
            t1.insert(i);
        } 
        else if (right[i] == 0 && left[i] == 0) {
            ans[i] = 1;
            t0.push(i);
        }
        else
        {
            st.insert(i);
        }
    }
    int k = ans.to_ulong();
    int cnt = k;
    priority_queue<int>pq;
    while(!(k != l && k != r && k >= l && k <= r)) 
    {
        if(st.empty())
        {
            break;
        }
        ans[*(st.begin())] = 1;
        pq.push(*(st.begin()));
        st.erase(st.begin());
        k = ans.to_ulong();
    }
    while(!(k != l && k != r && k >= l && k <= r))
    {
        if(k>r)
        {
            if(pq.empty())
            {
                 if(t0.empty())
                 {
                    break;
                 }
                 else
                 {
                    int v = t0.top();
                    t0.pop();
                    ans[v] = 0;
                    k = ans.to_ulong();
                    continue;
                 }
            }
            else
            {
                int v = pq.top();
                pq.pop();
                ans[v] = 0;
                k = ans.to_ulong();
                continue;
            }
        }
        if(t1.empty())
        {
            break;
        }
        ans[*(t1.begin())] = 1;
        t1.erase(t1.begin());
        k = ans.to_ulong();
    }
    cout<<k<<" "<<l<<" "<<r<<endl;
}

signed main()
{
    close;
    int T = 1;
    cin >> T;
    //cerr<< 2 * (134+132+137) - 2 * (134 & 132) - 2 * (134 & 137) - 2 * (132 & 137)<<endl;;
    //cerr<< 2 * (128 + 137 + 134) - 2 *(128 & 134) - 2 * (128 & 134) - 2 * (137 & 134);
    while (T--) {
        solved();
    }
    return 0;
}


Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define close ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)

void solved()
{
    int l,r;
    cin>>l>>r;
    int k = (l^r);
    bitset<31>b(k);
    int ans = 0;
    for(int i = 0;i<=30;i++)
    {
        if(b[i] == 1)
        {
            ans = i;
        }
    }
    int result = l | ((1 << ans) - 1 );
    cout<<result<<" ";
    cout<<result + 1<<" ";
    cout<<(result == l ? r : l )<<endl;
}



signed main()
{
    close;
    int T;
    cin>>T;
    while(T--)
    {
        solved();
    }
}
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;
#define int long long
#define endl '\n'
#define close ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

void solved()
{
    int l, r;
    cin >> l >> r;
    bitset<30> right(r);
    bitset<30> left(l);
    bitset<30> ans;
    set<int>st;
    for (int i = 0; i < 30; i++) {
        if (right[i] == 1 && left[i] == 1) {
            ans[i] = 0;
        } 
        else if (right[i] == 0 && left[i] == 0) {
            ans[i] = 1;
        }
        else
        {
            st.insert(i);
        }
    }

    int k = ans.to_ulong();

    while(!(k != l && k != r && k >= l && k <= r)) 
    {
        if(st.empty())
        {
            break;
        }
        ans[*(st.begin())] = 1;
        st.erase(st.begin());
        k = ans.to_ulong();
    }
    cout<<l<<" "<<r<<" "<<k<<endl;
}

signed main()
{
    close;
    int T = 1;
    cin >> T;
    while (T--) {
        solved();
    }
    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;
#define int long long
#define endl '\n'
#define close ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

void solved()
{
    int l, r;
    cin >> l >> r;
    bitset<30> right(r);
    bitset<30> left(l);
    bitset<30> ans;
    set<int>st;
    for (int i = 0; i < 30; i++) {
        if (right[i] == 1 && left[i] == 1) {
            ans[i] = 0;
        } 
        else if (right[i] == 0 && left[i] == 0) {
            ans[i] = 1;
        }
        else
        {
            st.insert(i);
        }
    }

    int k = ans.to_ulong();

    while(!(k != l && k != r && k >= l && k <= r)) 
    {
        if(st.empty())
        {
            break;
        }
        ans[*(st.begin())] = 1;
        st.erase(st.begin());
        k = ans.to_ulong();
    }
    cout<<l<<" "<<r<<" "<<k<<endl;
}

signed main()
{
    close;
    int T = 1;
    cin >> T;
    while (T--) {
        solved();
    }
    return 0;
}


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define close ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)

void solved()
{
    int l, r;
    cin >> l >> r;
    bitset<30> right(r);
    bitset<30> left(l);
    bitset<30> ans;
    set<int>st;
    int maxNum = 0;
    for(int i = 0;i<30;i++)
    {
        if(right[i] == 1)
        {
            maxNum = i;
        }
    }
    for (int i = 0; i <= maxNum; i++) {
        if (right[i] == 1 && left[i] == 1) {
            ans[i] = 0;
        } 
        else if (right[i] == 0 && left[i] == 0) {
            ans[i] = 1;
        }
        else
        {
            st.insert(i);
        }
    }

    int k = ans.to_ulong();

    while(!(k != l && k != r && k >= l && k <= r)) 
    {
        if(st.empty())
        {
            break;
        }
        ans[*(st.begin())] = 1;
        st.erase(st.begin());
        k = ans.to_ulong();
    }
    cout<<l<<" "<<r<<" "<<k<<endl;
}

signed main()
{
    close;
    int T = 1;
    cin >> T;
    while (T--) {
        solved();
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


Submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;

const int n_max = 1 * 1e5 + 7;




void solve(){
    int n, m;
    cin >> n >> m;
    priority_queue<int> b_elements;
    multiset<int> a_elements;
    int sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        sum += a;
        a_elements.insert(a);
    }
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        sum -= a;
        b_elements.push(a);
    }


    bool ans = true;
    if(sum != 0){
        ans = false;
    }
    while(ans and !b_elements.empty()){
        auto b = b_elements.top();
        b_elements.pop();
        if(b == 0){
            ans = false;
            break;
        }
        if(a_elements.find(b) == a_elements.end()){
            if(b == 1){
                ans = false;
                break;
            }
            b_elements.push(b/2);
            b_elements.push((b+1)/2);
        }else{
            auto a = a_elements.find(b);
            a_elements.erase(a);
        }
    }
    if(!a_elements.empty()){
        ans = false;
    }

    if(ans){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

    
}

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

    int t = 1;
    cin >> t;
    for(int i = 0; i < t; i++){
        solve();
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 6):
#include<bits/stdc++.h>
using namespace std;

const int n_max = 1 * 1e5 + 7;




void solve(){
    int n, m;
    cin >> n >> m;
    priority_queue<int> b_elements;
    multiset<int> a_elements;
    int sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        sum += a;
        a_elements.insert(a);
    }
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        sum -= a;
        b_elements.push(a);
    }


    bool ans = true;
    if(sum != 0){
        ans = false;
    }
    while(ans and !b_elements.empty()){
        auto b = b_elements.top();
        b_elements.pop();
        if(b == 0){
            ans = false;
            break;
        }
        if(a_elements.find(b) == a_elements.end()){
            if(b == 1){
                ans = false;
                break;
            }
            b_elements.push(b/2);
            b_elements.push((b+1)/2);
        }else{
            auto a = a_elements.find(b);
            a_elements.erase(a);
        }
    }
    if(!a_elements.empty()){
        ans = false;
    }

    if(ans){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

    
}

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

    int t = 1;
    cin >> t;
    for(int i = 0; i < t; i++){
        solve();
    }
    return 0;
}

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

const int n_max = 1 * 1e5 + 7;




void solve(){
    int n, m;
    cin >> n >> m;
    priority_queue<int> b_elements;
    multiset<int> a_elements;
    int sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        sum += a;
        a_elements.insert(a);
    }
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        sum -= a;
        b_elements.push(a);
    }


    bool ans = true;
    if(sum != 0){
        ans = false;
    }
    int counter = m - n + 5;
    while(ans and !b_elements.empty()){
        auto b = b_elements.top();
        b_elements.pop();
        if(b == 0){
            ans = false;
            break;
        }
        if(a_elements.find(b) == a_elements.end()){
            if(b == 1){
                ans = false;
                break;
            }
            counter--;
            if(counter == 0){
                ans = false;
                break;
            }

            b_elements.push(b/2);
            b_elements.push((b+1)/2);
        }else{
            auto a = a_elements.find(b);
            a_elements.erase(a);
        }
    }
    if(!a_elements.empty()){
        ans = false;
    }

    if(ans){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

    
}

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

    int t = 1;
    cin >> t;
    for(int i = 0; i < t; i++){
        solve();
    }
    return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

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

const int n_max = 1 * 1e5 + 7;




void solve(){
    int n, m;
    cin >> n >> m;
    priority_queue<int> b_elements;
    multiset<int> a_elements;
    int sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        sum += a;
        a_elements.insert(a);
    }
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        sum -= a;
        b_elements.push(a);
    }


    bool ans = true;
    if(sum != 0){
        ans = false;
    }
    int counter = m - n + 5;
    while(ans and !b_elements.empty()){
        auto b = b_elements.top();
        b_elements.pop();
        if(b == 0){
            ans = false;
            break;
        }
        if(a_elements.find(b) == a_elements.end()){
            if(b == 1){
                ans = false;
                break;
            }
            counter--;
            if(counter == 0){
                ans = false;
                break;
            }

            b_elements.push(b/2);
            b_elements.push((b+1)/2);
        }else{
            auto a = a_elements.find(b);
            a_elements.erase(a);
        }
    }
    if(!a_elements.empty()){
        ans = false;
    }

    if(ans){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

    
}

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

    int t = 1;
    cin >> t;
    for(int i = 0; i < t; i++){
        solve();
    }
    return 0;
}

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

const int n_max = 1 * 1e5 + 7;




void solve(){
    int n, m;
    cin >> n >> m;
    priority_queue<int> b_elements;
    multiset<int> a_elements;
    int sum = 0;
    for(int i = 0; i < n; i++){
        int a;
        cin >> a;
        sum += a;
        a_elements.insert(a);
    }
    for(int i = 0; i < m; i++){
        int a;
        cin >> a;
        sum -= a;
        b_elements.push(a);
    }


    bool ans = true;
    if(sum != 0){
        ans = false;
    }
    int counter = n - m + 5;
    while(ans and !b_elements.empty()){
        auto b = b_elements.top();
        b_elements.pop();
        if(b == 0){
            ans = false;
            break;
        }
        if(a_elements.find(b) == a_elements.end()){
            if(b == 1){
                ans = false;
                break;
            }
            counter--;
            if(counter == 0){
                ans = false;
                break;
            }

            b_elements.push(b/2);
            b_elements.push((b+1)/2);
        }else{
            auto a = a_elements.find(b);
            a_elements.erase(a);
        }
    }
    if(!a_elements.empty()){
        ans = false;
    }

    if(ans){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

    
}

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

    int t = 1;
    cin >> t;
    for(int i = 0; i < t; i++){
        solve();
    }
    return 0;
}