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


Submission (verdict: Wrong answer on test 1):
/*                                                     ॐ हं हनुमते नमः                                                                                              */

#include <bits/stdc++.h>
//#include "debugging.h"
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define ll long long
const int mod = 1000000007;
#define pb push_back
#define s second
#define f first
#define mp make_pair
#define rep(i,a,b) for(int i = a ; i<=b ; i++)
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define vvll vector<vector<long long>>
#define vpi vector<pair<int , int>>
#define Sort(a) sort(a.begin() , a.end())
#define Max(a) *max_element(a.begin() , a.end())
#define Min(a) *min_element(a.begin() , a.end())
/***************************************************************************************************************************************************************/

int binexpo(ll a, ll b, ll m = mod){ ll res = 1; a%=m; while(b>0){ if(b&1){ res= (res*a)%m; } a = (a*a)%m; b>>=1; } return res; }
int gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b);}
int lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
int modInverse(ll a, ll m) { return binexpo(a, m - 2, m); }
int modAdd(ll a, ll b, int m) { return ((a % m) + (b % m)) % m; }
int modMul(ll a, ll b, int m) { return ((a % m) * (b % m)) % m; }
int modSub(ll a, ll b, int m) { return ((a % m) - (b % m) + m) % m; }
int modDiv(ll a, ll b, int m) { return (modMul(a, modInverse(b, m), m) + m) % m; }
bool isPrime(int n) { if (n <= 1) return false; if (n <= 3) return true; if (n % 2 == 0 || n % 3 == 0) return false; for (int i = 5; i * i <= n; i = i + 6) if (n % i == 0 || n % (i + 2) == 0) return false; return true; }
int nCr(int n, int r) { if (r > n - r) r = n - r; int ans = 1; for (int i = 0; i < r; i++) { ans *= (n - i); ans /= (i + 1); } return ans; }
int nCrModP(int n, int r, int p = mod) { if (r > n - r) r = n - r; int C[r + 1]; memset(C, 0, sizeof(C)); C[0] = 1; for (int i = 1; i <= n; i++) { for (int j = min(i, r); j > 0; j--) C[j] = (C[j] + C[j - 1]) % p; } return C[r]; }
int nPr(int n, int r) { int ans = 1; for (int i = 0; i < r; i++) ans *= (n - i); return ans; }
int nPrModP(int n, int r, int p = mod) { int ans = 1; for (int i = 0; i < r; i++) ans = (ans * (n - i)) % p; return ans; }
int log(int num , int base){int ans = 0; while(num){num /= base;ans++;} return ans;}
int countSetBits(int x){int ans = 0;while(x){ans += (x&1);x >>= 1;}return ans;}
/***************************************************************************************************************************************************************/
/*Always High on CP*/

void legend(){
    ll l , r;cin>>l>>r;
    ll val = 0;
    int last = -1;
    for(int i = 63 ; i>=0 ; i--){
        if(!((r>>i)&1)){
            if(val + (1LL<<i) < r){
                val |= (1LL<<i);
            }
            last = i;
        }
    }
    ll val2 = 0;
    for(int i = 63 ; i>last ; i--){
        if(!((r>>i)&1)){
            // cout<<i<<" ";
            if(val2 + (1LL<<i) < r){
                val2 |= (1LL<<i);
            }
        }
    }
    // cout<<val2<<endl;
    if(val < l){
        val = l+1;
    }
    if(val2 < l){
        val2 = l;
    }
    cout<<r<<" "<<val<<" "<<val2<<endl;
}

/*Now setting the heart on fire*/

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int t;cin>>t;
    while(t--){
      legend();
    }
    return 0;
}