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

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

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define pb push_back
#define all(v) v.begin(), v.end()
#define pii pair<int, int>
#define vi vector<int>
#define inp for(int i=0;i<n;i++) cin>>arr[i]
#define vll vector<ll>
#define vvi vector<vector<int> >
#define vpii vector<pii >
#define mp make_pair
#define f first
#define s second

const int MOD = 1e9 + 7;
const int INF = 1e9;

// Function to print a vector
template <typename T>
void printVector(const vector<T>& v) {
    for (const auto& element : v) {
        cout << element << ' ';
    }
    cout << endl;
}

// Function to print a set
template <typename T>
void printSet(const set<T>& s) {
    for (const auto& element : s) {
        cout << element << ' ';
    }
    cout << endl;
}

// Function to print a map
template <typename K, typename V>
void printMap(const map<K, V>& m) {
    for (const auto& [key, value] : m) {
        cout << key << " -> " << value << endl;
    }
}
void func(int a,int b,int c){
    cout<<(a^b)+(b^c)+(c^a)<<endl;
}
void solve() {
    // Write your code here
    int l,r;
    cin>>l>>r;
    int msd = log2(r);
    vector<int> a1,a2;
    for(int i=msd ;i>=0;i--){
        if(l & (1LL << i)){
            a1.pb(1);
        }
        else a1.pb(0);
        if(r & (1LL << i)){
            a2.pb(1);
        }
        else a2.pb(0);
    }
    int num = 0;
    reverse(all(a1));
    reverse(all(a2));
    int a = 0,b = 0,c = 0;
    bool flag = true;
    for(int i=msd;i>=0;i--){
        if(a1[i] == a2[i] && flag){
            a += a1[i]*(1LL << i);
            b += a1[i]*(1LL << i);
            c += a1[i]*(1LL << i);
        }
        else{
            if(flag){
                a += (1LL<<i);
                flag = false;
            }
            else b += (1LL << i);
        }
    }
    for(int i=0;i<3;i++){
        if(i+l != a && i+l != b){
            c = l+i;
            break;
        }
    }
    cout<<a<<" "<<b<<" "<<c<<endl;
}
signed main() {
    fastio;
    int t = 1;
    cin >> t; // Uncomment if multiple test cases
    while (t--) {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <iostream>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);init_code();
#include<bits/stdc++.h>
#define ll long long 
#define read(x) int x;cin>>x;
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define vvl vector<vl>
#define vb vector<bool>
#define ld long double 
using namespace std;

void init_code(){
	#ifndef ONLINE_JUDGE
	freopen("inputf.txt","r",stdin);
	freopen("outputf.txt","w",stdout);
	#endif
}

ll min(ll a, ll b){
	if (a<b)return a;
	return b;
}

ll max(ll a, ll b){
	if (a>b)return a;
	return b;
}

void print(vi &arr){
	for (auto i:arr)cout <<i<<" ";
	cout <<endl;
}

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

int main(){
	fast ;
	read(t);
	while (t--)solve();
	return 0;
}