ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)


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

int main()
{
    int t;
    cin >> t;

    while (t--)
    {
        int n;
        cin >> n;
        vector<int> a(n);
        float sum_even = 0, sum_odd = 0, count_even = 0, count_odd = 0;

        for (int i = 0; i < n; i++)
        {
            cin >> a[i];
            if (i % 2 == 0)
            {
                sum_even += a[i];
                count_even++;
            }
            else
            {
                sum_odd += a[i];
                count_odd++;
            }
        }
        
        float avg_even = sum_even / count_even;
        float avg_odd = sum_odd / count_odd;
        
        if (fmod(avg_even, 2) != 0 || fmod(avg_odd, 2) != 0)
        {
            cout << "NO" << endl;
        }
        else if (count_even == 0 || count_odd == 0 || avg_even != avg_odd)
        {
            cout << "NO" << endl;
        }
        else
        {
            cout << "YES" << endl;
        }
    }

    return 0;
}
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)

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

int main()
{
    int t;
    cin >> t;

    while (t--) {
        int n;
        cin >> n;
        vector<float> a(n);
        double sum_even = 0, sum_odd = 0;
        int count_even = 0, count_odd = 0;

        for (int i = 0; i < n; ++i) {
            cin >> a[i];
            if (i % 2 == 0) { // Even index
                sum_even += a[i];
                count_even++;
            } else { // Odd index
                sum_odd += a[i];
                count_odd++;
            }
        }

        double avg_even = (count_even > 0) ? sum_even / count_even : 0;
        double avg_odd = (count_odd > 0) ? sum_odd / count_odd : 0;

        // Check if both averages are even
        if (static_cast<int>(avg_even) % 2 != 0 || static_cast<int>(avg_odd) % 2 != 0) {
            cout << "NO" << endl;
        } else if (count_even == 0 || count_odd == 0 || avg_even != avg_odd) {
            cout << "NO" << endl;
        } else {
            cout << "YES" << endl;
        }
    }

    return 0;
}


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

void solve(int t)
{
    while (t--)
    {
        int n;
        cin >> n;
        vector<int> v(n);
        long long odd = 0, even = 0, oddC = 0, evenC = 0;

        for (int i = 0; i < n; i++)
        {
            cin >> v[i];
            if (v[i] & 1)
            {
                odd += v[i];
                oddC++;
            }
            else
            {
                even += v[i];
                evenC++;
            }
        }

        bool isYes = false;
        if (even == odd)
            isYes = true;
        else if (oddC > 0 && evenC > 0)
        {
            double avgOdd = (double)odd / oddC;
            double avgEven = (double)even / evenC;

            if (avgOdd == avgEven || avgOdd == even || odd == avgEven)
                isYes = true;
        }

        cout << (isYes ? "YES" : "NO") << endl;
    }
}

int main()
{
    int t;
    cin >> t;
    solve(t);
    return 0;
}
Problem: 2050B - Transfusion
Language: C++23 (GCC 14-64, msys2)

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

void solve(int t)
{
    while (t--)
    {
        int n;
        cin >> n;
        vector<int> v(n);
        long long odd = 0, even = 0, oddC = 0, evenC = 0;

        for (int i = 0; i < n; i++)
        {
            cin >> v[i];
            if (v[i] & 1)
            {
                odd += v[i];
                oddC++;
            }
            else
            {
                even += v[i];
                evenC++;
            }
        }

        bool isYes = false;
        if (even == odd)
            isYes = true;
        else if (oddC > 0 && evenC > 0)
        {
            double avgOdd = (double)odd / oddC;
            double avgEven = (double)even / evenC;

            if (avgOdd == avgEven || avgOdd == even || odd == avgEven)
                isYes = true;
        }

        cout << (isYes ? "YES" : "NO") << endl;
    }
}

int main()
{
    int t;
    cin >> t;
    solve(t);
    return 0;
}


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

void solve(int t) {
    while (t--) {
        int n;
        cin >> n;
        vector<int> v(n);
        long long oddSum = 0, evenSum = 0, oddCount = 0, evenCount = 0;

        for (int i = 0; i < n; i++) {
            cin >> v[i];
            if (i % 2 == 0) {
                oddSum += v[i];
                oddCount++;
            } else {
                evenSum += v[i];
                evenCount++;
            }
        }

        bool isValid = false;

        if (oddSum % oddCount == 0 && evenSum % evenCount == 0) {
            if (oddSum / oddCount == evenSum / evenCount) {
                isValid = true;
            }
        }

        cout << (isValid ? "YES" : "NO") << endl;
    }
}

int main() {
    int t;
    cin >> t;
    solve(t);
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 4):
// Problem: A. Adrenaline Rush
// Contest: Codeforces - 2024-2025 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams
// Preferred) URL: https://codeforces.com/problemset/problem/2052/A Memory Limit: 1024 MB Time Limit: 3000 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
#ifndef __DEBUG__
#define dbg(...) 42
#endif
template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vi = vector<int>;

void solve()
{
    ll n;
    cin >> n;
    vl a(n), p(n + 1);
    for (auto &x : a)
        cin >> x;
    for (ll i = 0; i < n; ++i)
        p[a[i]] = i;
    using a2l = array<ll, 2>;
    vector<a2l> ans;
    for (ll i = 1; i <= n; ++i) {
        for (ll j = i + 1; j <= n; ++j) {
            if (p[i] > p[j])
                ans.push_back({j, i});
            else
                ans.push_back({j, i}), ans.push_back({i, j});
        }
    }
    cout << ans.size() << '\n';
    for (auto [x, y] : ans)
        cout << x << ' ' << y << '\n';
}

int main(int argc, char **argv)
{
    solve();
    return 0;
};
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
// Problem: B. Subsequence Update
// Contest: Codeforces - Codeforces Round 1000 (Div. 2)
// URL: https://codeforces.com/problemset/problem/2063/B
// Memory Limit: 256 MB
// Time Limit: 1500 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
#ifndef __DEBUG__
#define dbg(...) 42
#endif
template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;
using a2l = array<ll, 2>;
using pll = pair<ll, ll>;
using vl = vector<ll>;

void solve()
{
    ll n, l, r, cost = 0;
    cin >> n >> l >> r;
    vl a(n);
    for (auto &x : a)
        cin >> x;
    ranges::sort(a);
    cout << accumulate(a.begin(), a.begin() + r - l + 1, 0ll) << '\n';
}

int main(int argc, char **argv)
{
    ll t;
    cin >> t;
    while (t--)
        solve();
    return 0;
};
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Runtime error on test 2):
// Problem: B. Subsequence Update

// Contest: Codeforces - Codeforces Round 1000 (Div. 2)

// URL: https://codeforces.com/problemset/problem/2063/B

// Memory Limit: 256 MB

// Time Limit: 1500 ms

//

// Powered by CP Editor (https://cpeditor.org)



#include <assert.h>

#include <bits/stdc++.h>

using namespace std;

#ifndef __DEBUG__

#define dbg(...) 42

#endif

template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;



using ll = long long;

using a2l = array<ll, 2>;

using pll = pair<ll, ll>;

using vl = vector<ll>;



void solve()

{

    ll n, l, r, cost = 0;

    cin >> n >> l >> r;

    vl a(n);

    for (auto &x : a)

        cin >> x;

    l -= 1;

    vl b = a;

    vl c = a;

    sort(b.begin(), b.end() + l);

    sort(c.begin(), c.begin() + r, greater<ll>());

    auto cb = accumulate(b.begin() + l, b.begin() + r, 0ll);

    auto cc = accumulate(c.begin() + l, c.begin() + r, 0ll);

    cout << min(cb, cc) << '\n';

}



int main(int argc, char **argv)

{

    ll t;

    cin >> t;

    while (t--)

        solve();

    return 0;

};



Submission (verdict: Accepted):
// Problem: B. Subsequence Update
// Contest: Codeforces - Codeforces Round 1000 (Div. 2)
// URL: https://codeforces.com/problemset/problem/2063/B
// Memory Limit: 256 MB
// Time Limit: 1500 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
#ifndef __DEBUG__
#define dbg(...) 42
#endif
template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;
using a2l = array<ll, 2>;
using pll = pair<ll, ll>;
using vl = vector<ll>;

void solve()
{
    ll n, l, r;
    cin >> n >> l >> r;
    l -= 1;
    vl a(n);
    for (auto &x : a)
        cin >> x;
    vl b = a;
    vl c = a;
    sort(b.begin() + l, b.end());
    sort(c.begin(), c.begin() + r, greater<ll>());
    auto cb = accumulate(b.begin() + l, b.begin() + r, 0ll);
    auto cc = accumulate(c.begin() + l, c.begin() + r, 0ll);
    cout << min(cb, cc) << '\n';
}

int main(int argc, char **argv)
{
    ll t;
    cin >> t;
    while (t--)
        solve();
    return 0;
};
Problem: 2063B - Subsequence Update
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 2):
// Problem: B. Subsequence Update
// Contest: Codeforces - Codeforces Round 1000 (Div. 2)
// URL: https://codeforces.com/problemset/problem/2063/B
// Memory Limit: 256 MB
// Time Limit: 1500 ms
//
// Powered by CP Editor (https://cpeditor.org)

#include <assert.h>
#include <bits/stdc++.h>
using namespace std;
#ifndef __DEBUG__
#define dbg(...) 42
#endif
template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;
using a2l = array<ll, 2>;
using pll = pair<ll, ll>;
using vl = vector<ll>;

void solve()
{
    ll n, l, r, cost = 0;
    cin >> n >> l >> r;
    vl a(n);
    for (auto &x : a)
        cin >> x;
    ranges::sort(a);
    cout << accumulate(a.begin(), a.begin() + r - l + 1, 0ll) << '\n';
}

int main(int argc, char **argv)
{
    ll t;
    cin >> t;
    while (t--)
        solve();
    return 0;
};


Submission (verdict: Runtime error on test 2):
// Problem: B. Subsequence Update

// Contest: Codeforces - Codeforces Round 1000 (Div. 2)

// URL: https://codeforces.com/problemset/problem/2063/B

// Memory Limit: 256 MB

// Time Limit: 1500 ms

//

// Powered by CP Editor (https://cpeditor.org)



#include <assert.h>

#include <bits/stdc++.h>

using namespace std;

#ifndef __DEBUG__

#define dbg(...) 42

#endif

template <class T> using mpq = priority_queue<T, vector<T>, greater<T>>;



using ll = long long;

using a2l = array<ll, 2>;

using pll = pair<ll, ll>;

using vl = vector<ll>;



void solve()

{

    ll n, l, r, cost = 0;

    cin >> n >> l >> r;

    vl a(n);

    for (auto &x : a)

        cin >> x;

    l -= 1;

    vl b = a;

    vl c = a;

    sort(b.begin(), b.end() + l);

    sort(c.begin(), c.begin() + r, greater<ll>());

    auto cb = accumulate(b.begin() + l, b.begin() + r, 0ll);

    auto cc = accumulate(c.begin() + l, c.begin() + r, 0ll);

    cout << min(cb, cc) << '\n';

}



int main(int argc, char **argv)

{

    ll t;

    cin >> t;

    while (t--)

        solve();

    return 0;

};
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int sz=s.size();
        for(int i=0;i<sz;i++){
            int best=s[i]-'0',pos=i;
            for(int k=i;k<max(i+10,sz);k++){
                if(s[k]-'0'-(k-i)>best){
                    best= s[k]-'0'-(k-i);
                    pos=k;
                }
            }
            while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
        }
        cout<<s<<"\n";
    }
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
 
using namespace std;
 
void solve() {
    string s; cin >> s;
    for (int i = 0; i < s.size(); i++) {
        int best = s[i] - '0', pos = i;
        for (int j = i; j < min(i + 10, (int) s.size()); j++) {
            if (s[j] - '0' - (j - i) > best) {
                best = s[j] - '0' - (j - i);
                pos = j;
            }
        }
        while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
    }
    cout << s;
}
 
int main() {
    int TESTS = 1; cin >> TESTS;
    while (TESTS --> 0) {
        solve();
        cout << '\n';
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int sz=s.size();
        for(int i=0;i<sz;i++){
            int best=s[i]-'0',pos=i;
            for(int k=i;k<max(i+10,sz);k++){
                if(s[k]-'0'-(k-i)>best){
                    best= s[k]-'0'-(k-i);
                    pos=k;
                }
            }
            while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
        }
        cout<<s;
    }
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int sz=s.size();
        for(int i=0;i<sz;i++){
            int best=s[i]-'0',pos=i;
            for(int k=i;k<max(i+10,sz);k++){
                if(s[k]-'0'-(k-i)>best){
                    best= s[k]-'0'-(k-i);
                    pos=k;
                }
            }
            while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
        }
        cout<<s;
    }
}

Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
int main(){
    int t;
    cin>>t;
    while(t--){
        string s;
        cin>>s;
        int sz=s.size();
        for(int i=0;i<sz;i++){
            int best=s[i]-'0',pos=i;
            for(int k=i;k<max(i+10,sz);k++){
                if(s[k]-'0'-(k-i)>best){
                    best= s[k]-'0'-(k-i);
                    pos=k;
                }
            }
            while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
        }
        cout<<s<<"\n";
    }
}
Problem: 2049B - pspspsps
Language: C++23 (GCC 14-64, msys2)


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

using namespace std;

#pragma GCC optimize("Ofast")

#pragma GCC optimize("unroll-loops")

#define int long long

#define fi first

#define tc int t; cin >> t; while(t--)

#define se second

#define pb push_back

#define vi vector<int>

#define pii pair<int, int>

#define piii pair<int, pii>

#define vii vector<pii>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define debug cout<<"\ndebug\n";

typedef long long ll;

const int mxn = 1e5+20;

const int MOD = 1e9+7;

const int INF = LLONG_MAX;

int tot(int a, int b){return (a+b)%MOD;}

// int sub(int a, int b){return (a-b)%mod;}

// int mul(int a, int b){return (a*b)%mod;}

// int chmx(int &a, int b){ return max(a, b);}

// int chmn(int &a, int b){ return min(a, b);}



void solve(){

    int n, s=-1,p=-1; cin >> n;

    string ss; cin >> ss;

    bool ok = 0;

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

        if(ss[i]=='p' && p==-1){

            p=i;

        } 

        else if(ss[i] == 's'){

            s = i;

        } else ok = 1;

    }

    if(s > p)cout<<"NO"<<endl;

    else{

        if(n-s==p+1 && ok) cout << "NO" << endl;

        else cout << "YES"<<endl;

    }

}



int32_t main(){

    fastio; 

    int t = 1;

    cin >> t;

    while(t--){

        solve();

    }

    

    return 0;

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

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

using namespace std;

#pragma GCC optimize("Ofast")

#pragma GCC optimize("unroll-loops")

#define int long long

#define fi first

#define tc int t; cin >> t; while(t--)

#define se second

#define pb push_back

#define vi vector<int>

#define pii pair<int, int>

#define piii pair<int, pii>

#define vii vector<pii>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define debug cout<<"\ndebug\n";

typedef long long ll;

const int mxn = 1e5+20;

const int MOD = 1e9+7;

const int INF = LLONG_MAX;

int tot(int a, int b){return (a+b)%MOD;}

// int sub(int a, int b){return (a-b)%mod;}

// int mul(int a, int b){return (a*b)%mod;}

// int chmx(int &a, int b){ return max(a, b);}

// int chmn(int &a, int b){ return min(a, b);}



void solve(){

    int n, s=-1,p=-1; cin >> n;

    string ss; cin >> ss;

    bool ok = 0;

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

        if(ss[i]=='p' && p==-1){

            p=i;

        } 

        else if(ss[i] == 's'){

            s = i;

        } else ok = 1;

    }

    if(s > p)cout<<"NO"<<endl;

    else{

        if(n-s==p+1 && ok) cout << "NO" << endl;

        else cout << "YES"<<endl;

    }

}



int32_t main(){

    fastio; 

    int t = 1;

    cin >> t;

    while(t--){

        solve();

    }

    

    return 0;

}

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

using namespace std;

#pragma GCC optimize("Ofast")

#pragma GCC optimize("unroll-loops")

#define int long long

#define fi first

#define tc int t; cin >> t; while(t--)

#define se second

#define pb push_back

#define vi vector<int>

#define pii pair<int, int>

#define piii pair<int, pii>

#define vii vector<pii>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define debug cout<<"\ndebug\n";

typedef long long ll;

const int mxn = 1e5+20;

const int MOD = 1e9+7;

const int INF = LLONG_MAX;

int tot(int a, int b){return (a+b)%MOD;}

// int sub(int a, int b){return (a-b)%mod;}

// int mul(int a, int b){return (a*b)%mod;}

// int chmx(int &a, int b){ return max(a, b);}

// int chmn(int &a, int b){ return min(a, b);}



void solve(){

    int n, s=-1,p=-1; cin >> n;

    string ss; cin >> ss;

    bool ok = 0;

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

        if(ss[i]=='p' && p==-1){

            p=i;

        } 

        else if(ss[i] == 's'){

            s = i;

        } else ok = 1;

    }

    if(s > p && p!=-1)cout<<"NO"<<endl;

    else{

        if(n-s==p+1 && ok) cout << "NO" << endl;

        else cout << "YES"<<endl;

    }

}



int32_t main(){

    fastio; 

    int t = 1;

    cin >> t;

    while(t--){

        solve();

    }

    

    return 0;

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

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

using namespace std;

#pragma GCC optimize("Ofast")

#pragma GCC optimize("unroll-loops")

#define int long long

#define fi first

#define tc int t; cin >> t; while(t--)

#define se second

#define pb push_back

#define vi vector<int>

#define pii pair<int, int>

#define piii pair<int, pii>

#define vii vector<pii>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define debug cout<<"\ndebug\n";

typedef long long ll;

const int mxn = 1e5+20;

const int MOD = 1e9+7;

const int INF = LLONG_MAX;

int tot(int a, int b){return (a+b)%MOD;}

// int sub(int a, int b){return (a-b)%mod;}

// int mul(int a, int b){return (a*b)%mod;}

// int chmx(int &a, int b){ return max(a, b);}

// int chmn(int &a, int b){ return min(a, b);}



void solve(){

    int n, s=-1,p=-1; cin >> n;

    string ss; cin >> ss;

    bool ok = 0;

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

        if(ss[i]=='p' && p==-1){

            p=i;

        } 

        else if(ss[i] == 's'){

            s = i;

        } else ok = 1;

    }

    if(s > p && p!=-1)cout<<"NO"<<endl;

    else{

        if(n-s==p+1 && ok) cout << "NO" << endl;

        else cout << "YES"<<endl;

    }

}



int32_t main(){

    fastio; 

    int t = 1;

    cin >> t;

    while(t--){

        solve();

    }

    

    return 0;

}

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

using namespace std;

#pragma GCC optimize("Ofast")

#pragma GCC optimize("unroll-loops")

#define int long long

#define fi first

#define tc int t; cin >> t; while(t--)

#define se second

#define pb push_back

#define vi vector<int>

#define pii pair<int, int>

#define piii pair<int, pii>

#define vii vector<pii>

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)

#define debug cout<<"\ndebug\n";

typedef long long ll;

const int mxn = 1e5+20;

const int MOD = 1e9+7;

const int INF = LLONG_MAX;

int tot(int a, int b){return (a+b)%MOD;}

// int sub(int a, int b){return (a-b)%mod;}

// int mul(int a, int b){return (a*b)%mod;}

// int chmx(int &a, int b){ return max(a, b);}

// int chmn(int &a, int b){ return min(a, b);}



void solve(){

    int n, s=-1,p=-1; cin >> n;

    string ss; cin >> ss;

    if(ss[0] == 's')ss[0] = '.';

    if(ss[n-1]=='p')ss[n-1] = '.';

    bool foundp=0,founds=0;

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

        if(ss[i] == 'p')foundp=1;

        if(ss[i] == 's') founds=1;

    }

    cout << (foundp&&founds ? "NO":"YES")<<endl;

}



int32_t main(){

    fastio; 

    int t = 1;

    cin >> t;

    while(t--){

        solve();

    }

    

    return 0;

}