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;
//                                       Sk Najir
#ifndef ONLINE_JUDGE
#include "db.hpp"
#else
#define dbg(x)
#define dbg2(x, y)
#define dbg3(x, y, z)
#endif
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
// pre_define
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;

// Constants
const int MOD = 1e9 + 7;
int f(int a, int b, int c)
{
    return (a ^ b) + (b ^ c) + (c ^ a);
}
void call(int l, int r)
{
    int mx = 0;
    for (int i = l; i <= r; i++)
    {
        for (int j = i + 1; j <= r; j++)
        {
            for (int k = j + 1; k <= r; k++)
            {
                mx = max(mx, f(i, j, k));
            }
        }
    }
    //dbg(mx);
    for (int i = l; i <= r; i++)
    {
        for (int j = i + 1; j <= r; j++)
        {
            for (int k = j + 1; k <= r; k++)
            {
                if (f(i, j, k) == mx)
                {
                    cout << i << " " << j << " " << k << endl;
                    return;
                }
            }
        }
    }
}
int bit(int n)
{
    int i = 0;
    while (n > 0)
    {
        n >>= 1;
        i++;
    }
    return i;
}
void solve()
{
    int l, r;
    cin >> l >> r;
    int b = bit(r);
    b--;
    int i = b;
    int c = (1 << b);
    b = c - 1;
    while (b > 0)
    {
        if (b > l)
        {
            cout << b << " " << c << " " << l << endl;

            return;
        }
        else
        {
            i--;
            c = (1 << i);
            b = c - 1;
        }
    }
    call(l, r);
}

int main()
{
    IOS;
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++)
        solve();
}

Submission (verdict: Time limit exceeded on test 3):
#include <bits/stdc++.h>
using namespace std;
//                                       Sk Najir
#ifndef ONLINE_JUDGE
#include "db.hpp"
#else
#define dbg(x)
#define dbg2(x, y)
#define dbg3(x, y, z)
#endif
#define IOS                      \
    ios::sync_with_stdio(false); \
    cin.tie(0);                  \
    cout.tie(0);
// pre_define
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;

// Constants
const int MOD = 1e9 + 7;
int f(int a, int b, int c)
{
    return (a ^ b) + (b ^ c) + (c ^ a);
}

int bit(int n)
{
    int i = 0;
    while (n > 0)
    {
        n >>= 1;
        i++;
    }
    return i;
}
void solve()
{
    int l, r;
    cin >> l >> r;
    int res = (l ^ r);
    int bt = bit(res) - 1;
    int a = l | ((1<<bt)-1);
    int b = a + 1;
    int c = (a == l ? r : l);
    // dbg(f(a, b, c));

    cout << a << " " << b << " " << c << endl;
}

int main()
{
    IOS;

    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++)
        solve();
}