Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
const ll N = 2e5 + 10, LG = 20, mod = 1e9 + 7;

void burn()
{
    int l, r;
    cin >> l >> r;
    ll a, b, c;
    a = b = c = 0;
    for(int i = 29; i >= 0; i--)
    {
        if(a > b)
            swap(a, b);
        if(b > c)
            swap(b, c);
        if(a > c)
            swap(a, c);
        int must = ((a | ((1 << i) - 1)) < l);
        must += ((b | ((1 << i) - 1)) < l);
        must += ((c | ((1 << i) - 1)) < l);
        if((a | ((1 << i) - 1)) < l)
            a |= (1 << i);
        if((b | ((1 << i) - 1)) < l)
            b |= (1 << i);
        if((c | ((1 << i) - 1)) < l)
            c |= (1 << i);
        if(!must && (a |(1 << i)) <= r)
            a |= (1 << i);
    }
    if(a > b)
        swap(a, b);
    if(b > c)
        swap(b, c);
    if(a > c)
        swap(a, c);
//    cout << a << ' ' << b << ' ' << c << '\n';
    
    if(a == b)
    {
        int ii = -1;
        bool don = false;
        for(int i = 29; i >= 0; i--)
        {
            if(((1 << i) & a) && !((1 << i) & b) && (a ^ (1 << i)) && !don)
            {
                don = true;
                ii = i;
                a ^= (1 << i);
                continue;
            }
            if(don && (1 << i) & a)
                a ^= (1 << i);
            
        }
//        cout << ii << '\n';
        int pos = -1;
        for(int i = 29; i >= 0; i--)
        {
            if((1 << i) & a || i == ii)
                continue;
            int add = (ii == -1 ?0 :(ii < i ? (1 << ii) : 0));
            int cnt = ((1 << i) & b) > 0;
            cnt += ((1 << i) & c) > 0;
            if(!cnt && (a | (1 << i)) <= r)
                a |= (1 << i);
            else if((a | (1 << i)) <= r)
                pos = i;
            if((a | ((1 << i) - 1) - add) < l)
                a |= (1 << i);
        }
        if(a == b)
           assert(pos != -1), a |= (1 << pos);
    }
    assert(a != b && b != c);
    cout << a << ' ' << b << ' ' << c << '\n';
    
}

signed main()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
      cin >> t;
    while (t--)
        burn();
}

Submission (verdict: Wrong answer on test 1):
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<set>
//#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define N 500010
const ll INF = 1e18 + 10;
#define mod 998244353
//map<ll, ll>v;
ll n, maxn, k, m, q, p, pos;
ll a[N], b[N], c[N];
ll vis[N];
ll dis[N];
vector<ll>v;
ll sum, cnt;
struct node { int id, x; }nod[N];
bool cmp(node x, node y) { return x.x < y.x; }
ll num[3005][3005],f[3005][3005];
ll s[N];
map<ll, ll>mp;
void solve() {
	ll l, r;
	cin >> l >> r;
	k = __lg(l ^ r);
	ll x = (r >> k) << k, y = x - 1,z;
	if (y == 1)z = x + 1;
	else z = x - 2;
	cout << x << " " << y << " " << z << '\n';
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	//	freopen("input.txt","r",stdin);
	//  freopen("output.txt","w",stdout);
	int t = 1;
	cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}