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

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
// #define ordered_set tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update>

typedef long long int ll;
typedef long double ld;

const ld eps = 1e-9;
const int mod = 1000000007;
const ll inf = 1e18;
const int N1 = 2e5 + 10;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    // mt19937 rng((unsigned int)chrono::steady_clock::now().time_since_epoch().count());
    // auto start = chrono::high_resolution_clock::now();

    // code here. dont use mbinpow,binpow,right, fact and isprime as function names
    // (1/b)%M is (b^(M-2))%M

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

        int k = 0;
        for(int i=0;i<30;i++){
            if((l&(1<<i))^(r&(1<<i))){
                k = i;
            }
        }

        int val1 = (r >> k) << k;
        int val2 = val1 - 1;
        int val3;
        for (int i = l; i < min(l + 3, r);i++){
            if(i!=val1 && i!=val2){
                val3 = i;
                break;
            }
        }

        cout << val1 << " " << val2 << " " << val3 << '\n';
    }

}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
// #define ordered_set tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update>

typedef long long int ll;
typedef long double ld;

const ld eps = 1e-9;
const int mod = 1000000007;
const ll inf = 1e18;
const int N1 = 2e5 + 10;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    // mt19937 rng((unsigned int)chrono::steady_clock::now().time_since_epoch().count());
    // auto start = chrono::high_resolution_clock::now();

    // code here. dont use mbinpow,binpow,right, fact and isprime as function names
    // (1/b)%M is (b^(M-2))%M

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

        int k = 0;
        for(int i=0;i<30;i++){
            if((l&(1<<i))^(r&(1<<i))){
                k = i;
            }
        }

        int val1 = (r >> k) << k;
        int val2 = val1 - 1;
        int val3;
        for (int i = l; i <= min(l + 2, r);i++){
            if(i!=val1 && i!=val2){
                val3 = i;
                break;
            }
        }

        cout << val1 << " " << val2 << " " << val3 << '\n';
    }

}

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

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

int32_t main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t;
	cin >> t;
	while (t--)
	{
		int l, r;
		cin >> l >> r;
		int a = 0, b = 0, c;
		int k = 31;

		while (k >= 0)
		{
			if ((r & (1 << k)) == (l & (1 << k)))
			{
				if (l & (1 << k))
				{
					a |= (1 << k);
					b |= (1 << k);
				}

				k--;
			}
			else
			{
				a |= (1 << k);
				break;
			}
		}
		k--;

		while (k >= 0)
		{
			if (!(l & (1 << k)))
			{
				while (k >= 0)
				{
					if (!(l & (1 << k)))
						b |= (1 << k);
					k--;
				}
				break;
			}
			b |= (1 << k);
			k--;
		}
		if (b != l)
			cout << a << " " << b << " " << l << endl;
		else
			cout << a << " " << b << " " << r << endl;
	}
	return 0;
}


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

int32_t main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--)
  {
   int l,r;
   cin>>l>>r;
   int a=0,b=0,c;
   int k=31;
   if((r-l+1)==3)
   {
	cout<<l<<" "<<l+1<<" "<<r<<endl;
   continue;
   }
   while(k>=0)
   {
      if((r&(1<<k))==(l&(1<<k)))
	  {
		  if(l&(1<<k))
		  {
               a|=(1<<k);
			   b|=(1<<k);
		  } 

          k--;
	  }
	  else
	  {
		     a|=(1<<k);
             break;
	  }
	   
   }
   k--;
   
 while(k>=0)
 {
	if(!(l&(1<<k))){
		while(k>=0)
		{
			if(!(l&(1<<k))) b|=(1<<k);
			k--;
		}
		break;
	}
	 b|=(1<<k);
     k--;
 }

 cout<<a<<" "<<b<<" "<<l<<endl;







    
  }
  return 0;
}


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

Code 1:
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp> //ÓÃtree
using namespace std;
namespace pbds = __gnu_pbds;
template<typename T>
using pbdstree = pbds::tree<T,pbds::null_type,less<T>,pbds::rb_tree_tag,pbds::tree_order_statistics_node_update>;
#define int long long
using ll = long long;
template <typename T>
using Qmin = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using Qmax = priority_queue<T>;
#define rep(i, a, b) for(int i = a; i <= (b); ++i)
#define frep(i, a, b) for(int i = a; i < (b); ++i)
#define drep(i, a, b) for(int i = a; i >= (b); --i)
// #define ls (p << 1)
// #define rs (p << 1 | 1)
// #define mid ((l + r) >> 1)
const int MAXN = 200010;
const int MOD = 998244353;
// const int INF = 0x3f3f3f3f;
const int INF = 1e15;
int get(int x, int k){
    return (x >> k) & 1;
}
void solve(){
    int l, r;
    cin >> l >> r;
    int ans = 0;
    int i = 30;
    while(i >= 0){
        if(get(l, i) != get(r, i)) break;
        --i;
    }
    int x = (r >> i) << i;
    int y = x - 1;
    int z = x == r ? y - 1 : x + 1;
    cout << x << " " << y << " " << z << endl;
    return;
}
signed main(){
    // cout << (965321865 ^ 375544086) + (965321865 ^ 12551794) + (375544086 ^ 12551794) << endl;
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int _t = 1;
    cin >> _t;
    while(_t--){
        solve();
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp> //ÓÃtree
using namespace std;
namespace pbds = __gnu_pbds;
template<typename T>
using pbdstree = pbds::tree<T,pbds::null_type,less<T>,pbds::rb_tree_tag,pbds::tree_order_statistics_node_update>;
#define int long long
using ll = long long;
template <typename T>
using Qmin = priority_queue<T, vector<T>, greater<T>>;
template <typename T>
using Qmax = priority_queue<T>;
#define rep(i, a, b) for(int i = a; i <= (b); ++i)
#define frep(i, a, b) for(int i = a; i < (b); ++i)
#define drep(i, a, b) for(int i = a; i >= (b); --i)
// #define ls (p << 1)
// #define rs (p << 1 | 1)
// #define mid ((l + r) >> 1)
const int MAXN = 200010;
const int MOD = 998244353;
// const int INF = 0x3f3f3f3f;
const int INF = 1e15;
int get(int x, int k){
    return (x >> k) & 1;
}
void solve(){
    int l, r;
    cin >> l >> r;
    int ans = 0;
    int i = 30;
    while(i >= 0){
        if(get(l, i) != get(r, i)) break;
        --i;
    }
    r = (r >> i) << i;
    l = l + (1 << i) - 1;
    cout << r << " " << r << " " << l << endl;
    return;
}
signed main(){
    // cout << (965321865 ^ 375544086) + (965321865 ^ 12551794) + (375544086 ^ 12551794) << endl;
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int _t = 1;
    cin >> _t;
    while(_t--){
        solve();
    }
    return 0;
}

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

Code 1:
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
int l,r;
cin>>l>>r;
int temp=l^r;
int cnt=0;
while(temp!=0){temp>>=1;cnt++;}
cnt--;
//most significant differing in l,r bit is off 
int a=((1ll<<cnt)-1)|l; // xor with l to make it atleast l to keep "a" within range
// most significant differing bit in l,r is on
int b=a+1; // since r-l>1 b is always valid
int c=(a==l?r:l); // if a is l then b=l+1 so c can be from l+2 as r-l>1 
cout<<a<<" "<<b<<" "<<c<<endl;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while (t--) {
        solve();
    }
}

Code 2:
#include <bits/stdc++.h>
using namespace std;
#define int long long
void solve(){
int l,r;
cin>>l>>r;
int temp=r;
int cnt=0;
while(temp!=0){temp>>=1;cnt++;}
cnt--;
int a=1ll<<cnt;
int b=a-1;
int c=(a==r?l:r); //since l-r>1
cout<<a<<" "<<b<<" "<<c<<endl;
}
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t;
    cin>>t;
    while (t--) {
        solve();
    }
}

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

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

using namespace std;

#define int long long

int msb(int n) {

    // calculate the  number
    // of leading zeroes
    int k = __builtin_clz(n);

    // To return the value
    // of the number with set
    // bit at (31 - k)-th position
    // assuming 32 bits are used
    return 1 << (31 - k);
}

void solve() {
    int l, r, r1;
    cin >> l >> r, r1 = r;
    while (true) {
        if (msb(l) != msb(r)) {
            int a, b, c;
            for (int i = 0; i < 35; ++i) {
                if ((msb(r) <= (1ll << i)) && (r1 & (1ll << i))) {
                    int x = r1 & ((1ll << (i + 1)) - 1);
                    a = (r1 - x + msb(r)), b = a - 1, c = (a == r1 ? a - 2 : r1);
                    break;
                }
            }
            cout << a << ' ' << b << ' ' << c;
            return;
        }
        r ^= msb(r);
        l ^= msb(l);
    }

}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
        if (t)
            cout << '\n';
    }
}

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

using namespace std;

#define int long long

int msb(int n) {

    // calculate the  number
    // of leading zeroes
    int k = __builtin_clz(n);

    // To return the value
    // of the number with set
    // bit at (31 - k)-th position
    // assuming 32 bits are used
    return 1 << (31 - k);
}

void solve() {
    int l, r, r1;
    cin >> l >> r, r1 = r;
    while (true) {
        if (msb(l) != msb(r)) {
            int a, b, c;
            for (int i = 0; i < 35; ++i) {
                if ((msb(r) <= (1ll << i)) && (r1 & (1ll << i))) {
                    a = (r1 - (1ll << i) + msb(r)), b = a - 1, c = (a == r1 ? a - 2 : r1);
                    break;
                }
            }
            cout << a << ' ' << b << ' ' << c;
            return;
        }
        r ^= msb(r);
        l ^= msb(l);
    }

}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t = 1;
    cin >> t;
    while (t--) {
        solve();
        if (t)
            cout << '\n';
    }
}

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

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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t; cin >> t;
    while(t--) {
        int l, r; cin >> l >> r;
		
        int a=0, b=0, c=0, k=0;
        for(int i=30;i>=0;i--) {
            if((l&(1LL<<i))!=(r&(1LL<<i))) {
                // cout << (l&(1LL<<i)) << " " << (r&(1LL<<i)) << endl;
                a=k+(1LL<<i);
                b=a-1;
                break;
            } else {
                k+=(l&(1<<i)&&1)*(1LL<<i);
            }
        }

        for(c=l;c<=r&&(c==a||c==b);c++);
        cout << a << " " << b << " " << c << endl;
    }
}

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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t; cin >> t;
    while(t--) {
        int l, r; cin >> l >> r;
		
        int a=0, b=0, c=0, k=0;
        for(int i=30;i>=0;i--) {
            if((l&(1LL<<i))!=(r&(1LL<<i))) {
                a=k+(1LL<<i);
                b=a-1;
                break;
            } else {
                k=(l&(1<<i)&&1)*(1LL<<i);
            }
        }

        for(c=l;c<=r&&(c==a||c==b);c++);
        cout << a << " " << b << " " << c << endl;
    }
}

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

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

using i64 = long long;

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

    int a = l, c = r, b = 0;
    int pos;
    for (int i = 31; i >= 0; i --) {
        int x = a >> i & 1;
        int y = c >> i & 1;
        if (x ^ y) {
            pos = i;
            break;
        }
    }

    for (int i = 31; i > pos; i --) {
        int x = a >> i & 1;
        b += x * 1 << i;
    }

    for (int i = pos; i >= 0; i --) {
        int x = a >> i & 1;
        int y = c >> i & 1;
        if (x ^ y == 0) {
            b += (!x) << i;
        }
    }

    for (int i = pos; i >= 0; i --) {
        int x = a >> i & 1;
        int y = c >> i & 1;
        if (x ^ y) {
            if (b + (1 << i) < c) {
                b += 1 << i;
            }
        } 
    }

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

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(20);

    int T = 1;
    std::cin >> T;

    while (T --) {
        solve();
    }

    return 0;
}

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

using i64 = long long;

void solve() {
    i64 l, r;
    std::cin >> l >> r;

    i64 a = l, c = r, b = 0;
    int pos;
    for (int i = 32; i >= 0; i --) {
        int x = a >> i & 1;
        int y = c >> i & 1;
        if (x ^ y) {
            pos = i;
            break;
        }
    }

    for (int i = 32; i > pos; i --) {
        int x = a >> i & 1;
        b += x << i;
    }

    for (int i = pos; i >= 0; i --) {
        int x = a >> i & 1;
        int y = c >> i & 1;
        if (x ^ y) {
            if (b + (1 << i) < c) {
                b += 1ll << i;
            }
        } else {
            b += (!x) * 1ll << i;
        }
    }

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

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(20);

    int T = 1;
    std::cin >> T;

    while (T --) {
        solve();
    }

    return 0;
}

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

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

#define pb push_back

const int maxn = 2e5 + 10;
int l, r;

void solve(){
    cin>>l>>r;
    int a = 0;
    int b = 0;
    int c = 0;
    for(int i = 29; i >= 0; i--){
        if((1 << i) > r) continue;
        int x = ((r >> i) & 1);
        int y = ((l >> i) & 1);
        if(x == y && x == 1){
            a += (1 << i);
            b += (1 << i);
        }
        else if(x != y){
            a += (1 << i);
            b += ((1 << i) - 1);
            break;
        }
    }
    c = l;
    while(c == b || c == a) c++;
    cout<<a<<" "<<b<<" "<<c<<"\n";


}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T = 1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}


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

#define pb push_back

const int maxn = 2e5 + 10;
int l, r;

void solve(){
    cin>>l>>r;
    int a = 0;
    int b = 0;
    int c = 0;
    for(int i = 29; i >= 0; i--){
        if((1 << i) > r) continue;
        int x = ((r >> i) & 1);
        int y = ((l >> i) & 1);
        if(x == y){
            a += (1 << i);
            b += (1 << i);
        }
        else{
            a += (1 << i);
            b += ((1 << i) - 1);
            break;
        }
    }
    c = l;
    while(c == b || c == a) c++;
    cout<<a<<" "<<b<<" "<<c<<"\n";


}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T = 1;
    cin>>T;
    while(T--){
        solve();
    }
    return 0;
}


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

Code 1:
/* This was created by Ravinder Dathak.
 * Codeforces id by name of Mahadeva.
 * On 04-04-2024.
 * As proof that the following code is my own and authenticate.
*/

#include <bits/stdc++.h>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>

using namespace std;

//Uncomment during contest.
#define int long long int
#define double long double float

#define input(n) for(int i=0;i<(int)n;i++)

//uncomment during practice. Plz take care of int and long long int.
//typedef long long int ll;
//typedef long double ld;

const int Mod= 1e9+7;

//uncomment to use AutoCp and before any submission.
//  #define ONLINE_JUDGE

void solve(){
    int l,r;
    cin>>l>>r;
    int k;
    for(int i=30;i>=0;i--){
        if((l>>i)^(r>>i)){
            k=i;
            break;
        }
    }
    int a=l|((1<<k)-1),b=a+1,c=(a==l)?r:l;
    cout<<a<<' '<<b<<' '<<c<<endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("cmake-build-debug/input.txt","r",stdin);
    freopen("cmake-build-debug/output.txt","w",stdout);
#endif
    int t=1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Code 2:
/* This was created by Ravinder Dathak.
 * Codeforces id by name of Mahadeva.
 * On 04-04-2024.
 * As proof that the following code is my own and authenticate.
*/

#include <bits/stdc++.h>
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>

using namespace std;

//Uncomment during contest.
#define int long long int
#define double long double float

#define input(n) for(int i=0;i<(int)n;i++)

//uncomment during practice. Plz take care of int and long long int.
//typedef long long int ll;
//typedef long double ld;

const int Mod= 1e9+7;

//uncomment to use AutoCp and before any submission.
//  #define ONLINE_JUDGE

void solve(){
    int l,r;
    cin>>l>>r;
    if(l==0){
        cout<<l<<' '<<r-1<<' '<<r<<endl;
        return ;
    }
    int ans=0;
    for(int i=log2(r)-1;i>=0;i--){
        if( ((r>>i)&1) == 0 )ans+=(1<<i);
    }
    if(ans==0 || ans<=l)ans=l+1;
    cout<<l<<' '<<ans<<' '<<r<<endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#ifndef ONLINE_JUDGE
    freopen("cmake-build-debug/input.txt","r",stdin);
    freopen("cmake-build-debug/output.txt","w",stdout);
#endif
    int t=1;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

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

Code 1:
#include <bits/stdc++.h>
#define _fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(e) push_back(e)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define endl '\n'

using namespace std;
using i64 = long long;
using PII = pair<int,int>;
const int INF = 0x3f3f3f3f;
void fun()
{
    int n,m;
    cin >> n >> m;
    int k = 31 - __builtin_clz(n ^ m);
    int a = n | (1 << k - 1);
    int b = a + 1;
    int c = (a == n ? m : n);
    cout << a << ' ' << b << ' ' << c << endl;
}
int main() {
    int t;
    cin >> t;
    while(t -- ) fun();
    return 0;
}

Code 2:
#include <bits/stdc++.h>
#define _fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(e) push_back(e)
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define endl '\n'

using namespace std;
using i64 = long long;
using PII = pair<int,int>;
const int INF = 0x3f3f3f3f;
void fun()
{
    int n,m;
    cin >> n >> m;
    int k = 31 - __builtin_clz(n ^ m);
    int a = n | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == n ? m : n);
    cout << a << ' ' << b << ' ' << c << endl;
}
int main() {
    int t;
    cin >> t;
    while(t -- ) fun();
    return 0;
}

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

Code 1:
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = l | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == l ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}

Code 2:
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == batas_min ? batas_max : batas_min);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}

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

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

using namespace std;
#define int long long int
int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int 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";

    }
    // your code goes here

}

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

using namespace std;
#define int long long int
int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    int t;
    cin >> t;
    while (t--) {
        int l, r;
        cin >> l >> r;
        int a = 0, b = 0, c = 0, pos;
        for (int i = 30; i >= 0; i--) {
            int bit = (1 << i);
            if ((l & b) != (r & b)) {
                pos = i;
                break;
            }
        }

        a = l | ((1 << pos) - 1);
        b = a + 1;
        c = r;

        if (c == a || c == b) {
            c--;
        }
        if (c == a || c == b) {
            c--;
        }
        cout << a << " " << b << " " << c << "\n";

    }
    // your code goes here

}

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

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

#ifndef ONLINE_JUDGE
#include "DEBUG.h"
#define bug(...)           __f (#__VA_ARGS__, __VA_ARGS__)
#endif

#define first_in_out       ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll                 long long int
#define double             long double
#define print(a)           for(auto x : a) cout << x << " ";
#define printpair(a)       for(auto x : a) cout << x.first << " " << x.second<<"\n";



void solve()

{
    ll l, r;
    cin >> l >> r;
    ll a = 0, b = 0, c = 0;
    int f = 0;
    for (int j = 30; j >= 0; j--)
    {
        ll p = (1ll << j);

        if (f) {
            b += p;
            continue;
        }


        if ((l & p) == (r & p)) {
            if ((l & p))
                a += p, b += p;
        }
        else if ((l & p) != (r & p)) {
            a += p;
            f = 1;
        }

    }

    c = l;

    while (c == a or c == b)
        c++;

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


int main()
{
    first_in_out

    int t = 1;
    cin >> t;

    while (t--)
        solve();

}



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

#ifndef ONLINE_JUDGE
#include "DEBUG.h"
#define bug(...)           __f (#__VA_ARGS__, __VA_ARGS__)
#endif

#define first_in_out       ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll                 long long int
#define double             long double
#define print(a)           for(auto x : a) cout << x << " ";
#define printpair(a)       for(auto x : a) cout << x.first << " " << x.second<<"\n";



void solve()

{
    ll l, r;
    cin >> l >> r;
    ll a = 0, b = 0, c = 0;
    int f = 0;
    for (int j = 30; j >= 0; j--)
    {
        ll p = (1ll << j);

        if (f) {
            b += p;
            continue;
        }


        if ((l & p) == (r & p)) {
            if ((l & p))
                a += p, b += p;
        }
        else if ((l & p) != (r & p)) {
            a += p;
            f = 1;
        }

    }

    c = b;

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


int main()
{
    first_in_out

    int t = 1;
    cin >> t;

    while (t--)
        solve();

}



Answer: 1