ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
#include <bits/stdc++.h>

using namespace std;

void inline solve() {
    int l, r;
    cin >> l >> r;
    int a = 0, b = 0, c = 0;
    for (int mask = 1 << 30; mask > 0; mask >>= 1) {
        // cout << "A " << a << ' ' << b << ' ' << c << ' ' << mask << '\n';
        if ((l & mask) == (r & mask)) {
            a |= (l & mask);
            b |= (l & mask);
            c |= (l & mask);
        } else {
            a |= mask;
            b |= mask-2;
            c |= mask-1;
            break;
        }
    }
    cout << a << ' ' << b << ' ' << c << '\n';
    cout << (a ^ b) + (a ^ c) + (b ^ c) << '\n';
}

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

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

    return 0;
}

Code 2:
#include <bits/stdc++.h>

using namespace std;

void inline solve() {
    int l, r;
    cin >> l >> r;
    int a = 0, b = 0, c = 0;
    for (int mask = 1 << 30; mask > 0; mask >>= 1) {
        // cout << "A " << a << ' ' << b << ' ' << c << ' ' << mask << '\n';
        if ((l & mask) == (r & mask)) {
            a |= (l & mask);
            b |= (l & mask);
            c |= (l & mask);
        } else {
            a |= mask;
            b |= mask-1;
            if (b - 1 >= l) c = b-1;
            else c = a + 1;
            break;
        }
    }
    cout << a << ' ' << b << ' ' << c << '\n';
    // cout << (a ^ b) + (a ^ c) + (b ^ c) << '\n';
}

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

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

    return 0;
}

Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
#include <bits/stdc++.h>
#ifdef DEBUG
constexpr bool debug = true;
#else
constexpr bool debug = false;
#endif
using namespace std;
using u64 = uint64_t;
using i64 = int64_t;
using u32 = uint32_t;

int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    u32 l,r; cin >> l >> r;
    int k = 31 - __builtin_clz(l^r);
    u32 x = l | ((1<<k) - 1);
    u32 y = x + 1;
    u32 z = (x == l ? r : l);
    if constexpr (debug) {
      u32 max = (1 << k+1) -1;
      max <<= 1;
      printf("%u %u | ", max, (x^y)+(y^z)+(x^z));
    }
    printf("%u %u %u\n", x, y, z);
  }
}


Code 2:
#include <bits/stdc++.h>
#ifdef DEBUG
constexpr bool debug = true;
#else
constexpr bool debug = false;
#endif
using namespace std;
using u64 = uint64_t;
using i64 = int64_t;
using u32 = uint32_t;

int main() {
  int tc;
  cin >> tc;
  while (tc--) {
    u32 l,r; cin >> l >> r;
    u32 x = 1 << (31 - __builtin_clz(r));
    u32 y = x - 1;
    u32 z = 0;
    for (auto i = l; i <= r; i++) {
      if (i != x and i != y){
         z = i;
         break;
      }
    }
    if constexpr (debug) {
      u32 max = (1 << (32 - __builtin_clz(r))) -1;
      max <<= 1;
      printf("%u %u | ", max, (x^y)+(y^z)+(x^z));
    }
    printf("%u %u %u\n", x, y, z);
  }
}


Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++20 

Code 1:
#include <bits/stdc++.h>

using namespace std;

#define int int64_t
#define ar array

void solve() {
    int l,r; cin >> l >> r;
    int k = 0;
    for (int i = 0; i <= 30; i++) {
        if (((l^r)>>i) & 1) k = i;
    }
    int x = r & ((1 << 31) - (1 << k));
    if (r == x) cout << l << ' ' << x << ' ' << x-1 << '\n';
    else cout << r << ' ' << x << ' ' << x-1 << '\n';
}

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

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

Code 2:
#include <bits/stdc++.h>

using namespace std;

#define int int64_t
#define ar array

void solve() {
    int l,r; cin >> l >> r;
    int k = -1;
    for (int i = 0; i <= 30; i++) {
        if ((l^r)>>i & 1) k = i;
    }
    int x = r & (1 << 31 - 1 << k);
    if (r = x) cout << l << ' ' << x << ' ' << x-1 << '\n';
    else if (l == x) cout << r << ' ' << x << ' ' << x-1 << '\n';
}

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

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

Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
#include <bits/stdc++.h>
#define ll long long
using namespace std;

const ll mod = 1e9 + 7;

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

    int t;
    cin >> t;
    while (t--) {
        ll l, r;
        cin >> l >> r;

        ll ans1 = l;
        ll ans2 = 0;
        ll ans3 = r;
        ll msb = -1;

        
        for (ll i = 0; i < 60; i++) {
            if ((r & (1LL << i)) != 0) {
                msb = i;
            }
        }

        
        for (ll i = msb; i >= 0; i--) {
            if ((r & (1LL << i)) != 0 && (l & (1LL << i)) == 0) {
                ll temp = ans2;
                temp = ans2 | (1LL << i); 
                if (r == temp) {
                    ans2 = l;
                    for (int j = i - 1; j >= 0; j--) {
                        if ((l & (1LL << j)) == 0) {
                            ans2 = ans2 | (1LL << j);
                        }
                    }
                } else {
                    ans2 = ans2 | (1LL << i);
                    for(int j=i-1;j>=0;j--)
                    {
                      if ((r & (1LL << i)) == 0 && (l & (1LL << i)) == 0)
                      {
                        ans1=ans1|(1LL<<i);
                      }
                    }
                }
                break;
            } else {
                if ((r & (1LL << i)) != 0) {
                    ans2 = (ans2 | (1LL << i));
                }
            }
        }

        cout << ans1 << " " << ans2 << " " << ans3 << endl;
    }

    return 0;
}


Code 2:
#include <bits/stdc++.h>
#define ll long long
using namespace std;

const ll mod = 1e9 + 7;

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

    int t;
    cin >> t;
    while (t--) {
        ll l, r;
        cin >> l >> r;

        ll ans1 = l;
        ll ans2 = 0;
        ll ans3 = r;
        ll msb = -1;

        
        for (ll i = 0; i < 60; i++) {
            if ((r & (1LL << i)) != 0) {
                msb = i;
            }
        }

        
        for (ll i = msb; i >= 0; i--) {
            if ((r & (1LL << i)) != 0 && (l & (1LL << i)) == 0) {
                ll temp = ans2;
                temp = ans2 | (1LL << i); 
                if (r == temp) {
                    ans2 = l;
                    for (int j = i - 1; j >= 0; j--) {
                        if ((l & (1LL << j)) == 0) {
                            ans2 = ans2 | (1LL << j);
                        }
                    }
                } else {
                    ans2 = ans2 | (1LL << i);
                    for(int j=i-1;j>=0;j--)
                    {
                      if ((r & (1LL << j)) == 0 && (l & (1LL << j)) == 0)
                      {
                        ans1=ans1|(1LL<<j);
                      }
                    }
                }
                break;
            } else {
                if ((r & (1LL << i)) != 0) {
                    ans2 = (ans2 | (1LL << i));
                }
            }
        }

        cout << ans1 << " " << ans2 << " " << ans3 << endl;
    }

    return 0;
}


Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
using lli = long long;
lli mod = 1e9 + 7;
#define int lli

void solve(){
    int l,r;
    cin>>l>>r;
    int ltemp = l;
    int rtemp = r;

    int ans = -1;
    int i=0;
    while(l || r){
        if((l&1)!=(r&1)){
            ans = max(ans, i);
        }
        l=l>>1;
        r=r>>1;
        i++;
    }

    //cout<<ans<<endl;

    int num1 = 1<<ans;

    while(num1<=ltemp){
        i--;
        num1+=1<<i;    
    }
    int num2 = num1-1;
    

    if(num1<rtemp){
        cout<<num2<<" "<<num1<<" "<<rtemp<<endl;
    }else{
        cout<<num2<<" "<<num1<<" "<<ltemp<<endl;
    }
}

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

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

Code 2:
#include<bits/stdc++.h>
using namespace std;
#define endl '\n'
using lli = long long;
lli mod = 1e9 + 7;
#define int lli

void solve(){
    int l,r;
    cin>>l>>r;
    int ltemp = l;
    int rtemp = r;

    int ans = -1;
    int i=0;
    while(l || r){
        if((l&1)!=(r&1)){
            ans = max(ans, i);
        }
        l=l>>1;
        r=r>>1;
        i++;
    }

    //cout<<ans<<endl;

    int num1 = 1<<ans;
    for(int i=30; i>ans; i--){
        if((rtemp>>i)&1){
            num1|=(1<<i);
        }
    }
    int num2 = num1-1;
    

    if(num1<rtemp){
        cout<<num2<<" "<<num1<<" "<<rtemp<<endl;
    }else{
        cout<<num2<<" "<<num1<<" "<<ltemp<<endl;
    }
}

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

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

Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++20 

Code 1:
#include <bits/stdc++.h>
#pragma optimzie(2)
#define ll long long
using namespace std;

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a,b,c;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)!=(r&p)){
				a=p;b=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}

Code 2:
#include <bits/stdc++.h>
#pragma optimzie(2)
#define ll long long
using namespace std;

int l,r;
int main() {
    ios::sync_with_stdio(false);
	cin.tie(NULL), cout.tie(NULL);
    int T;cin>>T;
    while(T--){
    	cin>>l>>r;
    	int a=0,b=0,c=0;
		for(int i=30;i>=0;i--){
			int p=1<<i;
			if((l&p)==(r&p)){
				a+=(l&p);b+=(r&p);
			}
			else{
				a+=p;b+=p-1;break;
			}
		}
		if(a+1<=r){
			c=a+1;
		}
		else{
			c=b-1;
		}
		cout<<a<<' '<<b<<' '<<c<<endl;
	}
    return 0;
}

Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
#include<bits/stdc++.h>
using namespace std;
#define int long long
int t,l,r;
void work()
{
    for(int w = (1ll << 30);w >= 1;w >>= 1)
        if((l & w) != (r & w)) {
            int x = r / w * w;
            cout<<x<<" "<<x - 1<<" "<<(r == x ? l : r)<<endl;
            return;
        }
}
signed main()
{
    ios::sync_with_stdio(false);
    
    cin>>t;
    while(t--) cin>>l>>r,work();
    
    return 0;
}

Code 2:
#include<bits/stdc++.h>
using namespace std;
#define int long long
int t,l,r;
void work()
{
    for(int w = (1ll << 30);w >= 1;w >>= 1)
        if((l & w) != (r & w)) {
            int x = r / w * w;
            cout<<x<<" "<<x - 1<<" "<<(r == x ? x - 1 : x)<<endl;
            return;
        }
}
signed main()
{
    ios::sync_with_stdio(false);
    
    cin>>t;
    while(t--) cin>>l>>r,work();
    
    return 0;
}

Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++23 

Code 1:
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;

	int k = 31 - __builtin_clz(l ^ r);
	int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
	cout << a << " " << b << " " << c << "\n";
}

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



Code 2:
#include<iostream>
#include<vector>
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<queue>
#include<string.h>
#include <string>
#include<math.h>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<deque>
#include<functional>
using namespace std;

//#define int long long
#define ll long long
#define PA pair<ll,ll>
#define MAXN 100100


void solve() {
	ll l, r; cin >> l >> r;
	ll b = l;

	function<bool(ll)>check = [&](ll num)->bool {
		return num >= l && num <= r;
	};

	bool w = false;
	for (int i = 30; i >= 0; i--) {
		if ((l & (1 << i)) != (r & (1 << i))) {
			
		}
		else {
			if(check(b^(1<<i)))
				b = b ^ (1 << i);
		}
	}

	cout << l << " " << b << " " << r << endl;
}

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



Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++17 

Code 1:
// by iodwad
#include <bits/stdc++.h>

using namespace std;

void Solve() {
  int l, r, k; cin >> l >> r;
  for (int i = 30; ~i; --i) {
    if ((l ^ r) & (1 << i)) {
      k = i;
      break;
    }
  }
  int a, b, c;
  int tmp = (l >> k + 1) << k + 1;
  a = (1 << k) - 1 + tmp; b = a + 1; c = l;
  if (a == c) c = r;
  printf("%d %d %d\n", a, b, c);
}

int main() {
  int cases; cin >> cases;
  while (cases--) {
    Solve();
  }
  return 0;
}

Code 2:
// by iodwad
#include <bits/stdc++.h>

using namespace std;

void Solve() {
  int l, r, k; cin >> l >> r;
  for (int i = 30; ~i; --i) {
    if ((l ^ r) & (1 << i)) {
      k = i;
      break;
    }
  }
  int a, b, c;
  int tmp = (l >> k + 1) << k + 1;
  a = (1 << k) - 1 + tmp; b = a + 1; c = l;
  if (a == c) c = r;
  printf("%d %d %d\n", a, b, c);
}

int main() {
  int cases; cin >> cases;
  while (cases--) {
    Solve();
  }
  return 0;
}
/

Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++23 

Code 1:
#include <bits/stdc++.h>
using namespace std;

void solve() {
    int l, r;
    cin >> l >> r;

    // Find the highest bit where l and r differ.
    // __builtin_clz(x) gives the number of leading zeros in x,
    // so 31 - __builtin_clz(l ^ r) is the position of that highest differing bit (0-based).
    int k = 31 - __builtin_clz(l ^ r);

    // Construct a by setting all bits below k to 1 in l.
    int a = l | ((1 << k) - 1);

    // Then b is just a+1, and c is the opposite endpoint if a == l, else c = l.
    int b = a + 1;
    int c = (a == l ? r : l);

    // If b > r (edge case), simply pick the top three distinct values near r.
    // This handles the case where a+1 might exceed r.
    if (b > r) {
        a = r - 2;
        b = r - 1;
        c = r;
    }

    cout << a << " " << b << " " << c << "\n";
}

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

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


Code 2:
#include <bits/stdc++.h>
using namespace std;

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

    int t;
    cin >> t;
    while (t--) {
        long long l, r;
        cin >> l >> r;

        // Gather at most the last 8 numbers in [l, r].
        long long start = max(l, r - 7);
        vector<long long> cand;
        for (long long x = start; x <= r; x++) {
            cand.push_back(x);
        }

        // Brute force all distinct triples among these candidates.
        long long bestVal = -1;
        array<long long,3> bestTriple = {l, l+1, l+2}; // just a valid placeholder
        int sz = (int)cand.size();
        for (int i = 0; i < sz; i++) {
            for (int j = i + 1; j < sz; j++) {
                for (int k = j + 1; k < sz; k++) {
                    long long a = cand[i], b = cand[j], c = cand[k];
                    long long val = (a ^ b) + (b ^ c) + (a ^ c);
                    if (val > bestVal) {
                        bestVal = val;
                        bestTriple = {a, b, c};
                    }
                }
            }
        }

        // Output any triple that maximizes the expression.
        cout << bestTriple[0] << " "
             << bestTriple[1] << " "
             << bestTriple[2] << "\n";
    }
    return 0;
}


Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++23 

Code 1:
#include<bits/stdc++.h>
using namespace std;
typedef vector<long long int> vi;
#define ll long long
#define mp make_pair
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"

void solve() {
    ll l,r;
    cin>>l>>r;
    int k = 31 - __builtin_clz(l ^ r);
    int a = l | ((1 << k) - 1), b = a + 1, c = (a == l ? r : l);
    std::cout << a << " " << b << " " << c << "\n";
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t=1;
    cin>>t;
    while(t--) solve();
    return 0;
}

Code 2:
#include<bits/stdc++.h>
using namespace std;
typedef vector<long long int> vi;
#define ll long long
#define mp make_pair
#define yes cout << "YES" << "\n"
#define no cout << "NO" << "\n"

string decimalToBinary(ll decimal_number){
    bitset<64> binary(decimal_number);
    return binary.to_string();
}

ll binaryToDecimal(string &binary_string){
    bitset<64> binary(binary_string);
    return binary.to_ullong();
}

void solve() {
    ll l,r;
    cin>>l>>r;
    string a,b;
    a = decimalToBinary(l);
    b = decimalToBinary(r);
    ll x,y,z;
    for(ll i=0; i<a.size(); i++){
        if(a[i]!=b[i]) {
            x=i;
        }
    }
    for(ll i=x+1; i<a.size(); i++) b[i]='0';
    x = binaryToDecimal(b);
    y = x-1;
    z = x-2;
    if(z<l) z= x+1;
    cout<<x<<" "<<y<<" "<<z<<endl;
}


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t=1;
    cin>>t;
    while(t--) solve();
    return 0;
}

Answer: 1
Problem: 2057C - Trip to the Olympiad
Language: c++20 

Code 1:
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define endl '\n'
#define INT __int128
#define N 100010

using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned int;

int lowbit(int t)
{
	return t * -t;
}

void sol()
{
	int l, r;
	cin >> l >> r;
	int t = l ^ r;
	while(t != lowbit(t))
		t -= lowbit(t);
	t |= l;
	int a, b, c;
	a = t, b = t - 1, c = r;
	while(c == a || c == b)	c --;
	cout << a << ' ' << b << ' ' << c << endl;
}

int main() 
{
	IOS;
	int t = 1;
	cin >> t;
	while(t--)
		sol();
	return 0;
}

Code 2:
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//#define endl '\n'
#define INT __int128
#define N 100010

using namespace std;
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned int;

int lowbit(int t)
{
	return t & -t;
}

void sol()
{
	int l, r;
	cin >> l >> r;
	int t = l ^ r;
//	cout << t << endl;
	while(t != lowbit(t))
		t -= lowbit(t);
//	cout << t << endl;
	t = (l / t * t) | t;
//	cout << t << endl;
	int a, b, c;
	a = t, b = t - 1, c = r;
	while(c == a || c == b)	c --;
	cout << a << ' ' << b << ' ' << c << endl;
}

int main() 
{
	IOS;
	int t = 1;
	cin >> t;
	while(t--)
		sol();
	return 0;
}

Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++20 

Code 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!
*/


Code 2:
// 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!
*/


Answer: 2
Problem: 2057C - Trip to the Olympiad
Language: c++23 

Code 1:
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define bug(BUG) cout << "bug:# " << (BUG) << endl
#define bug2(BUG1, BUG2) cout << "bug:# " << (BUG1) << " " << (BUG2) << endl
#define bug3(BUG1, BUG2, BUG3) cout << "bug:# " << (BUG1) << ' ' << (BUG2) << ' ' << (BUG3) << endl
#define bugv(VEC)               \
    {                           \
        for (auto Vec : VEC)    \
            cout << Vec << ' '; \
        cout << '\n';           \
    }

void _();
signed main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(10);
    int T = 1;
    cin >> T;
    while (T--)
        _();
    return 0;
}

void _()
{
    int l, r;
    cin >> l >> r;
    int a = 0, b = 0, c = 0;
    int hi = 32;
    for (;; hi--)
    {
        int r_bit = r >> hi & 1, l_bit = l >> hi & 1;
        if (r_bit - l_bit)
            break;
        else if (l_bit)
        {
            a |= 1 << hi, b |= 1 << hi, c |= 1 << hi;
        }
    }
    c |= 1 << hi;
    b = c - 1;
    a = b - 1 < l ? c + 1 : b - 1;
    cout << a << ' ' << b << ' ' << c << '\n';
}
// void _()
// {
//     int a, b, c;
//     cin >> a >> b >> c;
//     cout << (a ^ b) + (b ^ c) + (a ^ c) << '\n';
// }

Code 2:
#include <bits/stdc++.h>
#define int long long
using namespace std;
#define bug(BUG) cout << "bug:# " << (BUG) << endl
#define bug2(BUG1, BUG2) cout << "bug:# " << (BUG1) << " " << (BUG2) << endl
#define bug3(BUG1, BUG2, BUG3) cout << "bug:# " << (BUG1) << ' ' << (BUG2) << ' ' << (BUG3) << endl
#define bugv(VEC)               \
    {                           \
        for (auto Vec : VEC)    \
            cout << Vec << ' '; \
        cout << '\n';           \
    }

void _();
signed main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(10);
    int T = 1;
    cin >> T;
    while (T--)
        _();
    return 0;
}

void _()
{
    int l, r;
    cin >> l >> r;
    int a = 0, b = 0, c = 0;
    int hi = 32;
    for (;; hi--)
    {
        int r_bit = r >> hi & 1, l_bit = l >> hi & 1;
        if (r_bit - l_bit)
            break;
        else if (l_bit)
        {
            a |= 1 << hi, b |= 1 << hi, c |= 1 << hi;
        }
    }
    c |= 1 << hi;
    b = c - 1;
    a = b - 1;
    cout << a << ' ' << b << ' ' << c << '\n';
}
// void _()
// {
//     int a, b, c;
//     cin >> a >> b >> c;
//     cout << (a ^ b) + (b ^ c) + (a ^ c) << '\n';
// }

Answer: 1