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

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

#define pb push_back
#define __lg(x) (int)log2(x)
#define ep emplace
#define x first
#define y second
#define lowbit(x) (x & (-x))
#define T_T 0
#define endl "\n"
#define Endl "\n"
#define ls u << 1
#define rs u << 1 | 1
#define i128 __int128
#define nmsl cout << "输出：\t"; // 农贸税率
#define retrun return
typedef long long ll;
typedef double db;
typedef ll LL;
typedef unsigned long long ull;
typedef pair<string, int> PSI;
typedef pair<double, double> PDD;
// mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 rng(time(0));
int T = 1;

namespace DBG {
    template <class T>
    ostream& operator<<(ostream& os, const vector<T>& v) {
        os << "[ ";
        for (const auto& x : v)
            os << x << ", ";
        os << "]";
        return os;
    }

    template <class A, class B>
    ostream& operator<<(ostream& os, const map<A, B>& mp) {
        os << "{ ";
        for (const auto& [k, v] : mp)
            os << k << ":" << v << ", ";
        os << "}";
        return os;
    }

    template <class T>
    void _dbg(const char* f, T t) {
        cerr << f << " = " << t << '\n';
    }

    template <class A, class... B>
    void _dbg(const char* f, A a, B... b) {
        while (*f != ',')
            cerr << *f++;
        cerr << " = " << a << ", ";
        _dbg(f + 1, b...);
    }
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
}
using namespace DBG;

const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
const int N = 2e5 + 5, M = 2e3 + 5;
const ll mod = 1e9 + 7;

#define int ll
#define double long double
typedef pair<int, int> PII;
ll n, m, x, y, k, l, r;
int a[N], b[N];

void jiangly()
{
    cin >> n >> m;
    int a = n, b = n ^ 1, c = n ^ 2;
    priority_queue<int>q;
    q.push(n);
    q.push(n^1);
    q.push(n^2);
    for (int i = 2; i <= 30; i++)
        if (!(n & (1 << i)))
        {
            int t = q.top();
            q.pop();
            if (t + (1 << i) <= m)t += (1 << i);
            q.push(t);
        }
    while (q.size())cout << q.top() << " ", q.pop();
    cout << endl;

//0011 1001 1000 1001 1010 0100 1000 1001
//0001 0110 0110 0010 0101 1001 0001 0110
//          1011 1111 1000 0110 0111 0010

//0011 1001 0011 0110 0010 0010 1111 1011
}
/*

*/

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //cout << fixed << setprecision(3);
    cin >> T;
    while (T--)jiangly();
    return 0;
}

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

#define pb push_back
#define __lg(x) (int)log2(x)
#define ep emplace
#define x first
#define y second
#define lowbit(x) (x & (-x))
#define T_T 0
#define endl "\n"
#define Endl "\n"
#define ls u << 1
#define rs u << 1 | 1
#define i128 __int128
#define nmsl cout << "输出：\t"; // 农贸税率
#define retrun return
typedef long long ll;
typedef double db;
typedef ll LL;
typedef unsigned long long ull;
typedef pair<string, int> PSI;
typedef pair<double, double> PDD;
// mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 rng(time(0));
int T = 1;

namespace DBG {
    template <class T>
    ostream& operator<<(ostream& os, const vector<T>& v) {
        os << "[ ";
        for (const auto& x : v)
            os << x << ", ";
        os << "]";
        return os;
    }

    template <class A, class B>
    ostream& operator<<(ostream& os, const map<A, B>& mp) {
        os << "{ ";
        for (const auto& [k, v] : mp)
            os << k << ":" << v << ", ";
        os << "}";
        return os;
    }

    template <class T>
    void _dbg(const char* f, T t) {
        cerr << f << " = " << t << '\n';
    }

    template <class A, class... B>
    void _dbg(const char* f, A a, B... b) {
        while (*f != ',')
            cerr << *f++;
        cerr << " = " << a << ", ";
        _dbg(f + 1, b...);
    }
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
}
using namespace DBG;

const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-8;
const int N = 2e5 + 5, M = 2e3 + 5;
const ll mod = 1e9 + 7;

#define int ll
#define double long double
typedef pair<int, int> PII;
ll n, m, x, y, k, l, r;
int a[N], b[N];

void jiangly()
{
    cin >> n >> m;
    int a = n, b = n ^ 1, c = n ^ 2;
    vector<int>v({ n,n ^ 1,n ^ 2 });
    priority_queue<int>q;
    q.push(n);
    q.push(n^1);
    q.push(n^2);
    for (int i = 2; i <= 30; i++)
        if (!(n & (1 << i)))
        {
            sort(v.begin(), v.end());
            if (v[0] + (1 << i) <= m)v[0] += (1 << i);
        }
        else
        {
            sort(v.begin(), v.end());
            if (v[2] - (1 << i) >= n)v[2] -= (1 << i);
        }
    cout << v[0] << " " << v[1] << " " << v[2];
    cout << endl;

//0011 1001 1000 1001 1010 0100 1000 1001
//0001 0110 0110 0010 0101 1001 0001 0110
//          1011 1111 1000 0110 0111 0010

//0011 1001 0011 0110 0010 0010 1111 1011
}
/*

*/

signed main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //cout << fixed << setprecision(3);
    cin >> T;
    while (T--)jiangly();
    return 0;
}