ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050D - Digital string maximization
Language: Java 21

Previous submission (verdict: Time limit exceeded on test 5):
import java.io.*;
import java.util.*;
public class Main
{

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        int t = Integer.parseInt(br.readLine());
        HashSet<Integer> indicies = new HashSet<>();
        char[] string;
        while(t-- > 0)
        {
            char[] c = br.readLine().toCharArray();
            string = new char[c.length];
            for(int i = 0; i < c.length; i++)
            {
                int max = -1;
                int index = -1;
                int count = 0;
                for(int j = 0; j < c.length; j++)
                {
                    if(count >= 10) break;
                    if(indicies.contains(j)) continue;
                    if(Integer.parseInt(Character.toString(c[j])) - count > max)
                    {
                        index = j;
                        max = Integer.parseInt(Character.toString(c[j])) - count;
                    }
                    count++;
                }
                indicies.add(index);
                string[i] = (char)(max + 48);

            }
            pw.println(new String(string));
            indicies.clear();
        }
        pw.close();

    }
}







Submission (verdict: Time limit exceeded on test 5):
import java.io.*;
import java.util.*;
public class Main
{

    public static void main(String[] args) throws IOException
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);
        int t = Integer.parseInt(br.readLine());
        HashSet<Integer> indicies = new HashSet<>();
        char[] string;
        while(t-- > 0)
        {
            char[] c = br.readLine().toCharArray();
            string = new char[c.length];
            for(int i = 0; i < c.length; i++)
            {
                int max = -1;
                int index = -1;
                int count = 0;
                for(int j = 0; j < c.length; j++)
                {
                    if(count >= 10) break;
                    if(indicies.contains(j)) continue;
                    if(c[j] - 48 - count > max)
                    {
                        index = j;
                        max = c[j] - 48 - count;
                    }
                    count++;
                }
                indicies.add(index);
                string[i] = (char)(max + 48);

            }
            pw.println(new String(string));
            indicies.clear();
        }
        pw.close();

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

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define new cout << endl;
#define cin(a)                  \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
typedef long double ld;
typedef long long ll;

 
void solve()
{
  int n,l,r;cin>>n>>l>>r;
  vector<int>a,b;
  for(int i=0;i<n;i++)
  {
    int x;cin>>x;
    a.pb(x);
  }
  for(int i=0;i<n;i++)
  {
    b.pb(a[i]);
  }
  for(int i=0;i<=(r-l);i++)
  {
    b.pb(a[i]);
  }
//for(auto u:b)cout<<u<<" ";
//cout<<endl;
  ll ans=INT_MAX;
  for(int i=0;i<n;i++)
  {
    ll x=0;
    {
        for(int j=i;j<=i+(r-l);j++)
        {
            x+=b[j];
        }
    }
    ans=min(ans,x);
  }
  cout<<ans<<endl;
}


int_fast32_t main()
{
    fast
        test
        solve();
    return 0;
}

Submission (verdict: Wrong answer on test 8):
#include <bits/stdc++.h>
using namespace std;
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define new cout << endl;
#define cin(a)                  \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
typedef long double ld;
typedef long long ll;

 
void solve()
{
  int n,l,r;cin>>n>>l>>r;
  vector<int>a,b,c;
  for(int i=0;i<n;i++)
  {
    int x;cin>>x;
    a.pb(x);
  }
  for(int i=0;i<r;i++)
  {
    b.pb(a[i]);
  }
  for(int i=l-1;i<n;i++)
  {
    c.pb(a[i]);
  }
  sort(all(b));
  sort(all(c));
  int sum1=0,sum2=0;
for(int i=0;i<((r-l)+1);i++)
{
    sum1+=b[i];
    sum2+=c[i];
}
 
  cout<<min(sum1,sum2)<<endl;
}


int_fast32_t main()
{
    fast
        test
        solve();
    return 0;
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define new cout << endl;
#define cin(a)                  \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
typedef long double ld;
typedef long long ll;

 
void solve()
{
  int n,l,r;cin>>n>>l>>r;
  vector<int>a,b;
  for(int i=0;i<n;i++)
  {
    int x;cin>>x;
    a.pb(x);
  }
  for(int i=0;i<n;i++)
  {
    b.pb(a[i]);
  }
  for(int i=0;i<=(r-l);i++)
  {
    b.pb(a[i]);
  }
//for(auto u:b)cout<<u<<" ";
//cout<<endl;
  ll ans=INT_MAX;
  for(int i=0;i<n;i++)
  {
    ll x=0;
    {
        for(int j=i;j<=i+(r-l);j++)
        {
            x+=b[j];
        }
    }
    ans=min(ans,x);
  }
  cout<<ans<<endl;
}


int_fast32_t main()
{
    fast
        test
        solve();
    return 0;
}
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;
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define test  \
    int t;    \
    cin >> t; \
    while (t--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define new cout << endl;
#define cin(a)                  \
    for (int i = 0; i < n; i++) \
        cin >> a[i];
typedef long double ld;
typedef long long ll;

 
void solve()
{
  int n,l,r;cin>>n>>l>>r;
  vector<int>a,b,c;
  for(int i=0;i<n;i++)
  {
    int x;cin>>x;
    a.pb(x);
  }
  for(int i=0;i<r;i++)
  {
    b.pb(a[i]);
  }
  for(int i=l-1;i<n;i++)
  {
    c.pb(a[i]);
  }
  sort(all(b));
  sort(all(c));
  int sum1=0,sum2=0;
for(int i=0;i<((r-l)+1);i++)
{
    sum1+=b[i];
    sum2+=c[i];
}
 
  cout<<min(sum1,sum2)<<endl;
}


int_fast32_t main()
{
    fast
        test
        solve();
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define fast                     \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
#define yes cout << "YES" << endl;
#define no cout << "NO" << endl;
#define test  \
    ll t;    \
    cin >> t; \
    while (t--)
#define all(v) v.begin(), v.end()
#define pb push_back
#define new cout << endl;
#define cin(a)                  \
    for (ll i = 0; i < n; i++) \
        cin >> a[i];
typedef long double ld;
typedef long long ll;

 
void solve()
{
  ll n,l,r;cin>>n>>l>>r;
  vector<ll>a,b,c;
  for(ll i=0;i<n;i++)
  {
    ll x;cin>>x;
    a.pb(x);
  }
  for(ll i=0;i<r;i++)
  {
    b.pb(a[i]);
  }
  for(ll i=l-1;i<n;i++)
  {
    c.pb(a[i]);
  }
  sort(all(b));
  sort(all(c));
  ll sum1=0,sum2=0;
for(ll i=0;i<((r-l)+1);i++)
{
    sum1+=b[i];
    sum2+=c[i];
}
 
  cout<<min(sum1,sum2)<<endl;
}


int_fast32_t main()
{
    fast
        test
        solve();
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

Previous submission (verdict: Compilation error):
#include<bits/stdc++.h>

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%r);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

} 

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

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0,sum=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%r);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

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


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

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%r);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else 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>

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0,sum=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%9);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

} 

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

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0,sum=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%9);

		if(r==9){

			cout<<"yes"<<endl;

			continue;

		}

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

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

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

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0,sum=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%r);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

} 

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

#define int long long

using namespace std;

string s;

signed main(){

	int T; cin>>T;

	while(T--){

		cin>>s;

		int h=s.size(),cnt2=0,cnt3=0,sum=0;

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

			if(s[i]=='2') cnt2++;

			else if(s[i]=='3') cnt3++;

			sum+=s[i]-'0';

		}

		int r=9-(sum%9);

		if(r&1) r+=9;

		r-=min(cnt3,r/6)*6;

		int x=r/2;

		if(cnt2>=x) cout<<"yes"<<endl;

		else cout<<"no"<<endl;

	}

	return 0;

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
bool check(vector<int>&vec,int sum,int i){
    
    if(i==vec.size()){
        return false;
    }
    int a=vec[i];
    if((sum+a*a-a)%9==0){
        return true;
    }
    return (check(vec,sum,i+1) or check(vec,sum+a*a-a,i+1));
}
void solve(){
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<s.length();i++){
        sum+=(s[i]-'0');
    }
    vector<int>vec;
    for(int i=0;i<s.length();i++){
        int a=(s[i]-'0');
        if(a<4 and a>0){
            vec.push_back(a);
        }
    }
    if(check(vec,sum,0)){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    solve();
	}

}


Submission (verdict: Time limit exceeded on test 6):
#include <bits/stdc++.h>
using namespace std;
bool check(vector<int>&vec,int sum,int i){
    
    if(i==vec.size()){
        return false;
    }
    int a=vec[i];
    if((sum+a*a-a)%9==0){
        return true;
    }
    return (check(vec,sum,i+1) or check(vec,sum+a*a-a,i+1));
}
void solve(){
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<s.length();i++){
        sum+=(s[i]-'0');
    }
    vector<int>vec;
    
    for(int i=0;i<s.length();i++){
        int a=(s[i]-'0');
        if(a<4 and a>0){
            vec.push_back(a);
        }
    }
    if(check(vec,sum,0) or sum%9==0){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    solve();
	}

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
bool check(vector<int>&vec,int sum,int i){
    
    if(i==vec.size()){
        return false;
    }
    int a=vec[i];
    if((sum+a*a-a)%9==0){
        return true;
    }
    return (check(vec,sum,i+1) or check(vec,sum+a*a-a,i+1));
}
void solve(){
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<s.length();i++){
        sum+=(s[i]-'0');
    }
    vector<int>vec;
    for(int i=0;i<s.length();i++){
        int a=(s[i]-'0');
        if(a<4 and a>0){
            vec.push_back(a);
        }
    }
    if(check(vec,sum,0)){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    solve();
	}

}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Time limit exceeded on test 6):
#include <bits/stdc++.h>
using namespace std;
bool check(vector<int>&vec,int sum,int i){
    
    if(i==vec.size()){
        return false;
    }
    int a=vec[i];
    if((sum+a*a-a)%9==0){
        return true;
    }
    return (check(vec,sum,i+1) or check(vec,sum+a*a-a,i+1));
}
void solve(){
    string s;
    cin>>s;
    int sum=0;
    for(int i=0;i<s.length();i++){
        sum+=(s[i]-'0');
    }
    vector<int>vec;
    
    for(int i=0;i<s.length();i++){
        int a=(s[i]-'0');
        if(a<4 and a>0){
            vec.push_back(a);
        }
    }
    if(check(vec,sum,0) or sum%9==0){
        cout<<"YES"<<endl;
    }
    else{
        cout<<"NO"<<endl;
    }
    
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    solve();
	}

}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
void solve(){
    string s;
    cin>>s;
    int sum=0;
    int two=0,three=0;
    for(int i=0;i<s.length();i++){
        sum=(sum+(s[i]-'0'))%9;
        if((s[i]-'0')==2){
            two++;
        }
        else if((s[i]-'0')==3){
            three++;
        }
    }
    for(int i=0;i<=two;i++){
        for(int j=0;j<=three;j++){
            if((sum+2*i+6*j)%9==0){
                cout<<"YES"<<endl;
                return;
            }
        }
    }
    cout<<"NO"<<endl;
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    solve();
	}

}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/contest/2057/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define int long long
#define inf 2e18
#define ull unsigned long long
#define ls o << 1
#define rs o << 1 | 1

using namespace std;

const int N = 2e5 + 9;

void solve()
{
	int l, r;cin >> l >> r;
	
	int ch = r - l + 1;
	int tmp = ch;
	int sum = 0;
	while(tmp) {
		sum ++;	
		tmp >>= 1;
	}
	
	sum --;
	int a = 0, b = 0, c = l;
	
	for(int i = 32;i > sum;i --) {
		a = (a | (c & (1ll << i)));
		b = (b | (c & (1ll << i)));
	}
	
	a = (a | (1ll << sum));
	b = (a | (1ll << sum)) - 1;
	
	while(c == a || c == b) {
		c ++;
	}
	
	cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int t = 1;cin >> t;
    while(t --)solve();

    return 0;
}


/*
What you want is what you love, so fight for it!
*/


Submission (verdict: Wrong answer on test 1):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/contest/2057/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define int long long
#define inf 2e18
#define ull unsigned long long
#define ls o << 1
#define rs o << 1 | 1

using namespace std;

const int N = 2e5 + 9;

void solve()
{
	int l, r;cin >> l >> r;
	
	int suml = 0, sumr = 0;
	
	int tmp = l;
	while(tmp) {
		suml ++;
		tmp >>= 1;
	}
	
	tmp = r;
	while(tmp) {
		sumr ++;
		tmp >>= 1;
	}
	
	int a = 0, b = 0, c = 0;
	if(sumr > suml) {
		a = 1ll << (sumr - 1);
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	} else {
		int idx;
		for(idx = sumr;idx >= 1;idx --) {
			a = (a | (1ll << (idx - 1)));
			if((r & (1ll << (idx - 1))) != (l & (1ll << (idx - 1))))
				break;
		}
		
		a = (a | (1ll << (idx - 1)));
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	}
	
	cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int t = 1;cin >> t;
    while(t --)solve();

    return 0;
}


/*
What you want is what you love, so fight for it!
*/
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/contest/2057/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define int long long
#define inf 2e18
#define ull unsigned long long
#define ls o << 1
#define rs o << 1 | 1

using namespace std;

const int N = 2e5 + 9;

void solve()
{
	int l, r;cin >> l >> r;
	
	int suml = 0, sumr = 0;
	
	int tmp = l;
	while(tmp) {
		suml ++;
		tmp >>= 1;
	}
	
	tmp = r;
	while(tmp) {
		sumr ++;
		tmp >>= 1;
	}
	
	int a = 0, b = 0, c = 0;
	if(sumr > suml) {
		a = 1ll << (sumr - 1);
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	} else {
		int idx;
		for(idx = sumr;idx >= 1;idx --) {
			a = (a | (1ll << (idx - 1)));
			if((r & (1ll << (idx - 1))) != (l & (1ll << (idx - 1))))
				break;
		}
		
		a = (a | (1ll << (idx - 1)));
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	}
	
	cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int t = 1;cin >> t;
    while(t --)solve();

    return 0;
}


/*
What you want is what you love, so fight for it!
*/


Submission (verdict: Accepted):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/contest/2057/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define int long long
#define inf 2e18
#define ull unsigned long long
#define ls o << 1
#define rs o << 1 | 1

using namespace std;

const int N = 2e5 + 9;

void solve()
{
	int l, r;cin >> l >> r;
	
	int suml = 0, sumr = 0;
	
	int tmp = l;
	while(tmp) {
		suml ++;
		tmp >>= 1;
	}
	
	tmp = r;
	while(tmp) {
		sumr ++;
		tmp >>= 1;
	}
	
	int a = 0, b = 0, c = 0;
	if(sumr > suml) {
		a = 1ll << (sumr - 1);
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	} else {
		int idx;
		for(idx = sumr;idx >= 1;idx --) {
			a = (a | (r & (1ll << (idx - 1))));
			if((r & (1ll << (idx - 1))) != (l & (1ll << (idx - 1))))
				break;
		}
		
		a = (a | (1ll << (idx - 1)));
		b = a - 1;
		c = l;
		while(c == a || c == b)c ++;
	}
	
	cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int t = 1;cin >> t;
    while(t --)solve();

    return 0;
}


/*
What you want is what you love, so fight for it!
*/
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 1):
// Problem: C. Trip to the Olympiad
// Contest: Codeforces - Hello 2025
// URL: https://codeforces.com/contest/2057/problem/C
// Memory Limit: 256 MB
// Time Limit: 2000 ms
// 
// Powered by CP Editor (https://cpeditor.org)

#include <bits/stdc++.h>
#define int long long
#define inf 2e18
#define ull unsigned long long
#define ls o << 1
#define rs o << 1 | 1

using namespace std;

const int N = 2e5 + 9;

void solve()
{
	int l, r;cin >> l >> r;
	
	int ch = r - l + 1;
	int tmp = ch;
	int sum = 0;
	while(tmp) {
		sum ++;	
		tmp >>= 1;
	}
	
	sum --;
	int a = 0, b = 0, c = l;
	
	for(int i = 32;i > sum;i --) {
		a = (a | (c & (1ll << i)));
		b = (b | (c & (1ll << i)));
	}
	
	a = (a | (1ll << sum));
	b = (a | (1ll << sum)) - 1;
	
	while(c == a || c == b) {
		c ++;
	}
	
	cout << a << ' ' << b << ' ' << c << '\n';
}

signed main()
{
    ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);

    int t = 1;cin >> t;
    while(t --)solve();

    return 0;
}


/*
What you want is what you love, so fight for it!
*/
Problem: 2050C - Uninteresting Number
Language: C++20 (GCC 13-64)

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



#define int long long



const int mod = 1e9 + 7;

const int inf = 1e18;



using namespace std;



void solve() 

{

    string a;

    cin >> a;

    int sm=0,cnt1=0,cnt2=0;

    for(auto &i:a) {

        sm+=(i-'0');

        if(i=='2') cnt1++;

        if(i=='3') cnt2++;

    }

    if(sm%9==0){

        cout << "YES";

        return;

    }

    for(int i=0; i<cnt2+1 && i<20; i++){

        for(int j=0; j<cnt1+1 && cnt1<20; j++){

            if((sm+6*i+2*j)%9==0){

                cout << "YES";

                return;

            }

        }

    }

    cout << "NO";

}



signed main() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);



    int t = 1;

    cin >> t;



    while (t--) {

        solve();

        cout << "\n";

    }

    return 0;

}



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



#define int long long



const int mod = 1e9 + 7;

const int inf = 1e18;



using namespace std;



void solve() 

{

    string a;

    cin >> a;

    int sm=0,cnt1=0,cnt2=0;

    for(auto &i:a) {

        sm+=(i-'0');

        if(i=='2') cnt1++;

        if(i=='3') cnt2++;

    }

    if(sm%9==0){

        cout << "YES";

        return;

    }

    for(int i=0; i<cnt2+1 && i<1000; i++){

        for(int j=0; j<cnt1+1 && cnt1<1000; j++){

            if((sm+6*i+2*j)%9==0){

                cout << "YES";

                return;

            }

        }

    }

    cout << "NO";

}



signed main() {

    ios_base::sync_with_stdio(false);

    cin.tie(0);



    int t = 1;

    cin >> t;



    while (t--) {

        solve();

        cout << "\n";

    }

    return 0;

}