ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

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

int main(){

  ll t, n, twos, threes, sum, rest, x, sixs;
  bool f;
  cin>>t;

  for (int i = 0; i < t; i++)
  {
    cin>>n;
    twos = 0; threes = 0;
    sum = 0;
    while(n != 0)
    {
      x = n%10;
      sum += x;
      n /= 10;
      if(x == 2){twos++;}
      else if(x == 3){threes++;}
    }
    
    rest = 9 - sum%9;
    //cout<<rest<<endl;
    
    if(rest == 9){
      cout<<"YES"<<endl;
    }
    else{
      f = false;
      sixs = 0;
      while(6*threes + 2*twos >= rest){
        sixs = rest/6;
        if(((rest-(6*sixs))%2 == 0) && ((rest-(6*sixs)) <= (2*twos))){
          cout<<"YES"<<endl;
          f = true;
          break;
        }
        rest += 9;
      }
      if(!f){
        cout<<"NO"<<endl;
      }

    }  
  }
  

  return 0;
}

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

int main(){

  ll t, n, twos, threes, sum, rest, x, sixs, counter;
  string s;
  char c;
  bool f;
  cin>>t;

  for (int i = 0; i < t; i++)
  {
    cin>>s;
    twos = 0; threes = 0;
    sum = 0; counter = 0;
    while(counter < s.length())
    {
      c = s[counter];
      x = c - '0';
      sum += x;
      if(x == 2){twos++;}
      else if(x == 3){threes++;}
      counter++;
    }
    
    rest = 9 - sum%9;
    
    if(rest == 9){
      cout<<"YES"<<endl;
    }
    else{
      f = false;
      sixs = 0;
      while(6*threes + 2*twos >= rest){
        sixs = rest/6;
        if(((rest-(6*sixs))%2 == 0) && ((rest-(6*sixs)) <= (2*twos))){
          cout<<"YES"<<endl;
          f = true;
          break;
        }
        rest += 9;
      }
      if(!f){
        cout<<"NO"<<endl;
      }

    }  
  }
  

  return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)


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

int main(){

  ll t, n, twos, threes, sum, rest, x, sixs;
  bool f;
  cin>>t;

  for (int i = 0; i < t; i++)
  {
    cin>>n;
    twos = 0; threes = 0;
    sum = 0;
    while(n != 0)
    {
      x = n%10;
      sum += x;
      n /= 10;
      if(x == 2){twos++;}
      else if(x == 3){threes++;}
    }
    
    rest = 9 - sum%9;
    cout<<rest<<endl;
    
    if(rest == 9){
      cout<<"YES"<<endl;
    }
    else{
      f = false;
      sixs = 0;
      while(6*threes + 2*twos >= rest){
        sixs = rest/6;
        if(((rest-(6*sixs))%2 == 0) && ((rest-(6*sixs)) <= (2*twos))){
          cout<<"YES"<<endl;
          f = true;
          break;
        }
        rest += 9;
      }
      if(!f){
        cout<<"NO"<<endl;
      }

    }  
  }
  

  return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

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

int main(){

  ll t, n, twos, threes, sum, rest, x, sixs;
  bool f;
  cin>>t;

  for (int i = 0; i < t; i++)
  {
    cin>>n;
    twos = 0; threes = 0;
    sum = 0;
    while(n != 0)
    {
      x = n%10;
      sum += x;
      n /= 10;
      if(x == 2){twos++;}
      else if(x == 3){threes++;}
    }
    
    rest = 9 - sum%9;
    cout<<rest<<endl;
    
    if(rest == 9){
      cout<<"YES"<<endl;
    }
    else{
      f = false;
      sixs = 0;
      while(6*threes + 2*twos >= rest){
        sixs = rest/6;
        if(((rest-(6*sixs))%2 == 0) && ((rest-(6*sixs)) <= (2*twos))){
          cout<<"YES"<<endl;
          f = true;
          break;
        }
        rest += 9;
      }
      if(!f){
        cout<<"NO"<<endl;
      }

    }  
  }
  

  return 0;
}

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

int main(){

  ll t, n, twos, threes, sum, rest, x, sixs;
  bool f;
  cin>>t;

  for (int i = 0; i < t; i++)
  {
    cin>>n;
    twos = 0; threes = 0;
    sum = 0;
    while(n != 0)
    {
      x = n%10;
      sum += x;
      n /= 10;
      if(x == 2){twos++;}
      else if(x == 3){threes++;}
    }
    
    rest = 9 - sum%9;
    //cout<<rest<<endl;
    
    if(rest == 9){
      cout<<"YES"<<endl;
    }
    else{
      f = false;
      sixs = 0;
      while(6*threes + 2*twos >= rest){
        sixs = rest/6;
        if(((rest-(6*sixs))%2 == 0) && ((rest-(6*sixs)) <= (2*twos))){
          cout<<"YES"<<endl;
          f = true;
          break;
        }
        rest += 9;
      }
      if(!f){
        cout<<"NO"<<endl;
      }

    }  
  }
  

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


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1] || a[1] > a[2]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1] || a[1] > a[2]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}


Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1] && a[1] > a[2]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    if (a[n - 2] > a[n - 1] && a[1] > a[2]) {
        cout << "nO\n";
    } else {
        cout << "yEs\n";
    }
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

Submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 1; i < n; ++i) {
        if (a[i - 1] >= a[i]) {
            cout << "nO\n";
            return;
        }
        a[i - 1] -= a[i];
        a[i] = 0;
    }
    cout << "YeS\n";
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 1; i < n; ++i) {
        if (a[i - 1] >= a[i]) {
            cout << "nO\n";
            return;
        }
        a[i - 1] -= a[i];
        a[i] = 0;
    }
    cout << "YeS\n";
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}

Submission (verdict: Accepted):
#include <iostream>
#include <vector>
#include <set>
#include <utility>
#include "algorithm"

using namespace std;

#define int long long


void solve() {
    int n;
    cin >> n;
    vector <int> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int i = 1; i < n; ++i) {
        if (a[i - 1] > a[i]) {
            cout << "nO\n";
            return;
        }
        int t = min(a[i], a[i - 1]);
        a[i - 1] -= t;
        a[i] -= t;
    }
    cout << "YeS\n";
}




signed main() {
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<pi> vpi;
typedef vector<vector<pi>> vvpi;
typedef vector<vector<vector<pi>>> vvvpi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<long double> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;

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

    int T;
    cin >> T;
    while (T--)
    {
        int N, l, r;
        cin >> N >> l >> r;
        vi v(N);
        for (auto& i : v) cin >> i;

        vi s1 = vi(v.begin(), v.begin() + r);
        vi s2 = vi(v.begin() + l - 1, v.end());
        sort(s1.begin(), s1.end());
        sort(s2.begin(), s2.end());

        int sum1 = 0, sum2 = 0;

        for (int i = 0; i < r - l + 1; i++)
        {
            sum1 += s1[i];
            sum2 += s2[i];
        }
        
        cout << min(sum1, sum2) << '\n';
    }
}

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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<pi> vpi;
typedef vector<vector<pi>> vvpi;
typedef vector<vector<vector<pi>>> vvvpi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<long double> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;

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

    int T;
    cin >> T;
    while (T--)
    {
        int N, l, r;
        cin >> N >> l >> r;
        vll v(N);
        for (auto& i : v) cin >> i;

        vll s1 = vll(v.begin(), v.begin() + r);
        vll s2 = vll(v.begin() + l - 1, v.end());
        sort(s1.begin(), s1.end());
        sort(s2.begin(), s2.end());

        ll sum1 = 0, sum2 = 0;

        for (int i = 0; i < r - l + 1; i++)
        {
            sum1 += s1[i];
            sum2 += s2[i];
        }
        
        cout << min(sum1, sum2) << '\n';
    }
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<pi> vpi;
typedef vector<vector<pi>> vvpi;
typedef vector<vector<vector<pi>>> vvvpi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef vector<long double> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;

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

    int T;
    cin >> T;
    while (T--)
    {
        int N, l, r;
        cin >> N >> l >> r;
        vi v(N);
        for (auto& i : v) cin >> i;

        vi mid = vi(v.begin() + l - 1, v.begin() + r);

        sort(mid.begin(), mid.end(), greater<int>());


        int sum1 = 0;
        if (l != 0)
        {
            vi bg = vi(v.begin(), v.begin() + l);
            sort(bg.begin(), bg.end());
            int idx = 0;
            
            for (auto i : mid)
            {
                int temp = i;
                if (idx < bg.size())
                {
                    temp = min(temp, bg[idx]);
                }
                sum1 += temp;
                idx++;
            }
        }
        
        int sum2 = 0;
        vi ng = vi(v.begin() + r, v.end());
        sort(ng.begin(), ng.end());
        int idx = 0;
        for (auto i : mid)
        {
            int temp = i;
            if (idx < ng.size())
            {
                temp = min(temp, ng[idx]);
            }
            sum2 += temp;
            idx++;
        }
        cout << min(sum1, sum2) << '\n';
    }
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


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

#define ll long long

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

#define endl '\n'

using namespace std;

void solve()

{

    int n,l,r;

    cin>>n>>l>>r;

    vector<ll>v(n),pre,post;

    for (auto &m:v){

        cin>>m;}

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

        if(i<l-1)pre.push_back(v[i]);

        else if(i>r-1)post.push_back(v[i]);

        else {

            pre.push_back(v[i]);

            post.push_back(v[i]);

        }

    }

    sort(all(pre));

    sort(all(post));

    int k=r-l+1;

    ll cnt=0,mn=INT_MAX;

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

        cnt+=pre[i];

    }

    mn=min(mn,cnt);

    cnt=0;

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

        cnt+=post[i];

    }

    cout<<min(mn,cnt)<<endl;

}

int main()

{

    int t=1;

    cin>>t;

    while(t--){

        solve();

    }

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
using namespace std;
void solve()
{
    int n,l,r;
    cin>>n>>l>>r;
    vector<ll>v,pre,post;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        if(i<l)pre.push_back(x);
        else if(i>r)post.push_back(x);
        else {
            pre.push_back(x);
            post.push_back(x);
        }
    }
    sort(all(pre));
    sort(all(post));
    int k=r-l+1;
    ll cnt=0,mn=INT_MAX;
    for(int i=0;i<k;i++){
        cnt+=pre[i];
    }
    mn=min(mn,cnt);
    cnt=0;
    for(int i=0;i<k;i++){
        cnt+=post[i];
    }
    cout<<min(mn,cnt)<<endl;
}
int main()
{
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
using namespace std;
void solve()
{
    int n,l,r;
    cin>>n>>l>>r;
    vector<ll>v,pre,post;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        if(i<l)pre.push_back(x);
        else if(i>r)post.push_back(x);
        else {
            pre.push_back(x);
            post.push_back(x);
        }
    }
    sort(all(pre));
    sort(all(post));
    int k=r-l+1;
    ll cnt=0,mn=1e18;
    for(int i=0;i<k;i++){
        cnt+=pre[i];
    }
    mn=min(mn,cnt);
    cnt=0;
    for(int i=0;i<k;i++){
        cnt+=post[i];
    }
    mn=min(mn,cnt);
    cout<<mn<<endl;
}
int main()
{
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

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

#define ll long long

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

#define endl '\n'

using namespace std;

void solve()

{

    int n,l,r;

    cin>>n>>l>>r;

    vector<ll>v(n),pre,post;

    for (auto &m:v){

        cin>>m;}

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

        if(i<l-1)pre.push_back(v[i]);

        else if(i>r-1)post.push_back(v[i]);

        else {

            pre.push_back(v[i]);

            post.push_back(v[i]);

        }

    }

    sort(all(pre));

    sort(all(post));

    int k=r-l+1;

    ll cnt=0,mn=INT_MAX;

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

        cnt+=pre[i];

    }

    mn=min(mn,cnt);

    cnt=0;

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

        cnt+=post[i];

    }

    cout<<min(mn,cnt)<<endl;

}

int main()

{

    int t=1;

    cin>>t;

    while(t--){

        solve();

    }

}



Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
using namespace std;
void solve()
{
    int n,l,r;
    cin>>n>>l>>r;
    vector<ll>v,pre,post;
    for(int i=1;i<=n;i++){
        int x;
        cin>>x;
        if(i<l)pre.push_back(x);
        else if(i>r)post.push_back(x);
        else {
            pre.push_back(x);
            post.push_back(x);
        }
    }
    sort(all(pre));
    sort(all(post));
    int k=r-l+1;
    ll cnt=0,mn=INT_MAX;
    for(int i=0;i<k;i++){
        cnt+=pre[i];
    }
    mn=min(mn,cnt);
    cnt=0;
    for(int i=0;i<k;i++){
        cnt+=post[i];
    }
    cout<<min(mn,cnt)<<endl;
}
int main()
{
    int t=1;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <algorithm>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <vector>
#include <set>
#include <unordered_set>
#include <utility>
#include <limits.h>
#include <climits>
#include <numeric>
#include <map>
#include <unordered_map>
#include <cfloat>
#define ll long long
#define int long long
#define DEBUG false
using namespace std;


void debug(string s) {
    if (DEBUG) cout << s << endl;
}

void debug(int s) {
    if (DEBUG) cout << s << endl;
}

void debug(vector<vector<int> > & v) {
    if (!DEBUG) return;
    for (int i = 0; i != v.size(); ++i) {
        for (int j = 0; j != v[i].size(); ++j) {
            cout << v[i][j] << " ";
        }
        cout << endl;
    }
}

//flat debug of vector of vectors
void fdebug(vector<vector<int> > & v) {
    if (!DEBUG) return;
    for (int i = 0; i != v.size(); ++i) {
        for (int j = 0; j != v[i].size(); ++j) {
            cout << v[i][j];
            if (j != v[i].size() - 1) {
                cout << " ";
            }
        }
        cout << "; ";
    }
    cout << endl;
}


void debug(vector<int> & v) {
    if (!DEBUG) return;
    for (int i = 0; i != v.size(); ++i) {
        cout << v[i] << " ";
    }
    cout << endl;
}


class Solution {
    int l, r;
public:
    void init() {
        cin >> l >> r;
    }

    ll solve() {
        init();
        int a = 0;
        int b = 0;
        int c = 0;

        for (int i = 30; i >= 0; --i) {
            int li = (l >> i) & 1;
            int ri = (r >> i) & 1;
            if (li != ri) {
                if (r > (1 << i)) {
                    a += (1 << i) + 1;
                    b += (1 << i);
                    c += (1 << i) - 1;
                } else {
                    a += (1 << i);
                    b += (1 << i) - 1;
                    c += (1 << i) - 2;
                }
            } else if (li == 1) {
                a += (1 << i);
                b += (1 << i);
                c += (1 << i);
            }
        }
        
        cout << a << " " << b << " " << c << endl;
        return 0;
    }

};


signed main()
{
    std::ios_base::sync_with_stdio (false);
    std::cin.tie(NULL);
    int n;
    cin >> n;
    Solution sol;
    for(int i = 1; i != n + 1; ++i) {
        //cout << fixed << setprecision(0) << sol.solve() << "\n";
        sol.solve();
    }

    return 0;
}
Problem: 2063B - Subsequence Update
Language: Java 21


Submission (verdict: Wrong answer on test 8):
import java.util.Scanner;

public class Subsequence_Update{

    public static void merge(int[] arr, int l, int m, int r){

        int n1 = m - l + 1;

        int n2 = r - m;



        int[] L = new int[n1];

        int[] R = new int[n2];



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

            L[i] = arr[l + i];

        }



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

            R[i] = arr[m + 1 + i];

        }



        int i = 0;

        int j = 0;

        int k = l;



        while(i<n1 && j<n2){

            if(L[i] <= R[j]){

                arr[k] = L[i];

                i++;

            }else{

                arr[k] = R[j];

                j++;

            }

            k++;

        }



        while(i<n1){

            arr[k] = L[i];

            i++;

            k++;

        }



        while(j<n2){

            arr[k] = R[j];

            j++;

            k++;

        }

    }

    public static void mergeSort(int[] arr, int l, int r){

        if(l<r){

            int m = (l+r)/2;

            mergeSort(arr, l, m);

            mergeSort(arr, m+1, r);

            merge(arr, l, m, r);

        }

    }

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        int t = sc.nextInt();

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

            int n = sc.nextInt();

            int l = sc.nextInt();

            int r = sc.nextInt();

            int[] arr = new int[n];

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

                arr[j] = sc.nextInt();

            }



            int[] arr1 = new int[r];

            for(int j = 0; j<r; j++){

                arr1[j] = arr[j];

            }



            int[] arr2 = new int[n-l + 1];

            for(int j = 0; j<n-l+1; j++){

                arr2[j] = arr[j+l-1];

            }



            mergeSort(arr1, 0, r-1);

            mergeSort(arr2, 0, n-l);



            int sum1 = 0;

            int sum2 = 0;



            for(int j = 0; j<(r - l + 1); j++){

                sum1 += arr1[j];

                sum2 += arr2[j];

            }



            if(sum1<=sum2){

                System.out.println(sum1);

            }else{

                System.out.println(sum2);

            }

        }

    }

}