Problem: 2057C - Trip to the Olympiad
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define FOR(i, x, n) for(int i = x; i < n; i++)
#define F0R(i, n) FOR(i, 0, n)
#define ROF(i, x, n) for(int i = n - 1; i >= x; i--)
#define R0F(i, n) ROF(i, 0, n)

#define WTF cout << "WTF" << endl

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define F first
#define S second
#define PB push_back
#define EP emplace_back

#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()

using namespace std;

typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;

typedef complex<LD> Point;

const int N = 2e5 + 7;
const int INF = 1e9 + 7;
const int LOG = 22;
const int A = 26;
const int SQ = 320;
const int MOD = 1e9 + 7;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int l, r;

void solve() {
    cin >> l >> r;

    LL a  = 0, b = 0, c = 0;

    R0F(i, 31) {
        if (((r >> i) & 1) != ((l >> i) & 1)) {
            a |= (1LL << i);

            if (r == a) {
                b = (1LL << i) - 1;
                c = (1LL << i) - 2;
            }

            else {
                b = (1LL << i) + 1;
                c = (1LL << i) - 1;
            }

            break;
        }

        else if (((r >> i) & 1) == 1) {
            a |= (1LL << i);
        }
    }

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

int main() {
    IOS;
    int t; cin >> t;
    while(t--) solve();
}


Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define FOR(i, x, n) for(int i = x; i < n; i++)
#define F0R(i, n) FOR(i, 0, n)
#define ROF(i, x, n) for(int i = n - 1; i >= x; i--)
#define R0F(i, n) ROF(i, 0, n)

#define WTF cout << "WTF" << endl

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define F first
#define S second
#define PB push_back
#define EP emplace_back

#define ALL(x) x.begin(), x.end()
#define RALL(x) x.rbegin(), x.rend()

using namespace std;

typedef long long LL;
typedef long double LD;

typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;

typedef complex<LD> Point;

const int N = 2e5 + 7;
const int INF = 1e9 + 7;
const int LOG = 22;
const int A = 26;
const int SQ = 320;
const int MOD = 1e9 + 7;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int l, r;

void solve() {
    cin >> l >> r;

    LL a  = 0, b = 0, c = 0;

    R0F(i, 31) {
        if (((r >> i) & 1) != ((l >> i) & 1)) {
            a |= (1LL << i);

            if (r == a) {
                b = a - 1;
                c = b - 1;
            }

            else {
                b = a + 1;
                c = a - 1;
            }

            break;
        }

        else if (((r >> i) & 1) == 1) {
            a |= (1LL << i);
            b |= (1LL << i);
            c |= (1LL << i);
        }
    }

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

int main() {
    IOS;
    int t; cin >> t;
    while(t--) solve();
}