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

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

using namespace std;

#define ll long long
#define ld long double
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back

ll inf = 1e18, mod = 1e9 + 7;

ll gcd(ll a, ll b) {
    while (a != 0 && b != 0) {
        if (a > b) {
            a %= b;
        }
        else {
            b %= a;
        }
    }
    return a + b;
}

ll lcm(ll a, ll b) {
    return (a * b) / gcd(a, b);
}

ll binpow(ll base, ll p) {
    if (p == 0) return 1;
    else if (p % 2) return binpow(base, p - 1) * base;
    else return binpow(base, p / 2) * binpow(base, p / 2);
}

void solve() {
    ll l, r;
    cin >> l >> r;
    ll cnt = 1, sz = 1;
    while (cnt * 2 <= r) {
        sz++;
        cnt *= 2;
    }
    cnt = 1;
    ll sz1 = 0;
    while (cnt * 2 <= l) {
        cnt *= 2;
        sz1++;
    }
    vector <int> bit, bit1;
    for (int i = 0; i < sz; ++i) {
        if (r & (1 << i)) bit.pb(1);
        else bit.pb(0);
    }
    ll s = 0;
    for (int i = 0; i < bit.size(); ++i) {
        if (!bit[i]) {
            bit1.pb(1);
            s += (1 << i);
        }    
        else bit1.pb(0);
    }
    if (s >= l) {
        if (s & 1) {
            if (s - 1 < l) {
                cout << r << " " << s << " " << s + 1 << "\n";
            }
            else {
                cout << r << " " << s << " " << s - 1 << "\n";
            }
        }
        else {
            if (s + 1 >= r) {
                cout << r << " " << s << " " << s - 1 << "\n";
            }
            else {
                cout << r << " " << s << " " << s + 1 << "\n";
            }
        }
    }
    else {
        for (int i = sz1; i >= 0; --i) {
            if (!bit1[i] && s + (1 << i) <= r) {
                s += (1 << i);
                if (s >= l) break;
            }
        }
        if (s & 1) {
            if (s - 1 < l) {
                cout << r << " " << s << " " << s + 1 << "\n";
            }
            else {
                cout << r << " " << s << " " << s - 1 << "\n";
            }
        }
        else {
            if (s + 1 >= r) {
                cout << r << " " << s << " " << s - 1 << "\n";
            }
            else {
                cout << r << " " << s << " " << s + 1 << "\n";
            }
        }
    }
}

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

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

using namespace std;
#define int long long
#define ull unsigned long long int
#define dl double long
#define all(x) x.begin(), x.end()
#define ss second
#define ff first
const int N = 2 * 1e5 + 10;
const int M = 1e9 + 7;
#define Priyanshu_Mishra

Priyanshu_Mishra

void solve()
{
    int l, r;
    cin >> l >> r;
    int x = log2(r);
    if ((1ll << (x - 1)) >= l + 1) {
        cout << (1ll << (x)) << " " << (1ll << (x - 1)) << " " << (1ll << (x - 1)) - 1 << endl;
        return;
    }
    int a=(1ll<<x);
    int y = log2(r);
    int temp=(1ll<<(y+1))-1;
    int b=0;
    for (; y >= 0; y--) {
           if(((1ll<<y)&a)){
            if ((temp - (1ll << y)) > l) {
                temp-=(1ll << y);
            }
            else b+=(1ll<<y);
        }
        else if(b+(1ll<<y)<r)b+=(1ll<<y);
    }
    // if(b==0)b=l+1;
    int  c = b- 1;
    
    cout << a << " " << b << " " << c << endl;




}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int testcases = 1;
    cin >> testcases;
    while (testcases--)
    {
        solve();
        #ifdef Priyanshu_Mishra
        cerr << "\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms\n";
        #endif
    }
    return 0;
}

Answer: 1