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

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#ifdef AMAN_MAC
#include "debug.h"
#else
#define debug(...)
#endif

using namespace __gnu_pbds;using namespace std;
#define int int64_t

template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T, typename R> using ordered_map = tree<T, R, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int M = 1e9 + 7;
template <typename T> std::istream& operator>>(std::istream& in, std::vector<T>& vec) { for(auto &v : vec) in>>v;return in;}
template <typename T> std::ostream& operator<<(std::ostream& out,std::vector<T>& vec) { for(auto &v : vec) out<<v<<" ";return out;}
int mul(int a, int b) { return ((a % M) * (b % M)) % M; }int madd(int a, int b) { return (a % M + b % M) % M; }
int mpow(int a, int b) { int pow = a, res = 1; while (b) { if (b & 1)res = mul(res, pow);pow = mul(pow, pow);b >>= 1; }return res; }
int minv(int a) { return mpow(a, M - 2); }int mdiv(int a, int b) { return mul(a, minv(b)); }int msub(int a, int b) { return (a % M - b % M + M) % M; }
int binlog(int a,int b){ int cnt=0; while(a>=b){a/=b; cnt++; } return cnt; }
void solve() {
    int l,r;
    cin>>l>>r;
    int p = 1;
    while(p*2<=r-l)p*=2;
    int a = (r/p)*p;
    if(a-2>=l)cout<<a<<" "<<a-1<<" "<<a-2;
    else cout<<a+1<<" "<<a<<" "<<a-1;
}

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t; cin >> t; for(int i = 0;i < t; i++ ) { solve(); cout << "\n";}
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/detail/standard_policies.hpp>
#ifdef AMAN_MAC
#include "debug.h"
#else
#define debug(...)
#endif

using namespace __gnu_pbds;using namespace std;
#define int int64_t

template <typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T, typename R> using ordered_map = tree<T, R, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
const int M = 1e9 + 7;
template <typename T> std::istream& operator>>(std::istream& in, std::vector<T>& vec) { for(auto &v : vec) in>>v;return in;}
template <typename T> std::ostream& operator<<(std::ostream& out,std::vector<T>& vec) { for(auto &v : vec) out<<v<<" ";return out;}
int mul(int a, int b) { return ((a % M) * (b % M)) % M; }int madd(int a, int b) { return (a % M + b % M) % M; }
int mpow(int a, int b) { int pow = a, res = 1; while (b) { if (b & 1)res = mul(res, pow);pow = mul(pow, pow);b >>= 1; }return res; }
int minv(int a) { return mpow(a, M - 2); }int mdiv(int a, int b) { return mul(a, minv(b)); }int msub(int a, int b) { return (a % M - b % M + M) % M; }
int binlog(int a,int b){ int cnt=0; while(a>=b){a/=b; cnt++; } return cnt; }
void solve() {
    int l,r;
    cin>>l>>r;
    int p = 1;
    int mask=0;
    for(int i=32;i>=0;i--){
        int v = 1LL<<i;
        if(v > r)continue;
        if(r>=(mask+v) and l<=(mask+v-1)){
            cout<<mask+v<<" "<<mask+v-1<<" ";
            if(mask+v-1 == l)cout<<mask+v+1;
            else cout<<mask+v-2;return;
        }
        if(mask+v<=r)mask+=v;
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int t; cin >> t; for(int i = 0;i < t; i++ ) { solve(); cout << "\n";}
    return 0;
}