Problem: 2057C - Trip to the Olympiad
Language: c++17 

Solution 1 (runtime: 62 ms):
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb(g) push_back((ll) g)
#define loop(i,lvalue, uvalue) for(ll i=(ll) lvalue;i<(ll) uvalue;i++)
#define rloop(i,uvalue, lvalue) for(ll i=(ll) uvalue-1;i>=(ll) lvalue;i--)
#define iloop(lvalue,uvalue) for(ll i=(ll) lvalue;i<(ll) uvalue;i++)
#define itr(v) for(auto i : v)
#define pll pair<ll,ll>
#define vll vector<ll>
#define vpll vector<pll>
#define all(a) a.begin(),a.end()
#define endl <<"\n"
#define F first
#define S second
#define SZ size()
#define setmem(a,n,m) for(ll i=0;i<n;i++) {a[i]=m;}
#define calsum(a,n,sum) for(ll i=0;i<n;i++){sum+=a[i];}
#define cv(vx, lim) for(ll i=0;i<lim;i++) { ll opp ; cin>>opp ; vx.pb(opp);}
bool flag = true;
ll binpow(ll a,ll b){ll res=1;while(b>0){if(b&1)res=res*a;a= a*a;b >>= 1;}return res;}

#ifdef dbug
#include "debugger.hpp" 
#define cerr cout
#else
#define deb(...)
#endif


void cs(ll T)
 {
    cout<<"Case #"<<T<<": " ;
 }
void solve()
{ 
  ll l,r;
  cin>>l>>r;
  ll msd=0, msb=0;

  for(ll i= 31;i>=0;i--){
     if((((1LL<<i)&r))  && !msb) {
         msb=i;
     }
     if(((1LL<<i)&r)!= ((1LL<<i)&l)){
       msd=i; break;
     }
  }
  ll x= 0, y=0;
  // deb(msb,msd);

  // cout<<(1LL<<msd)<<"   ";
  for(ll i=0;i<=msb;i++){
      if(i<msd){
         x|=(1LL<<i);
      }
      else if(i==msd){
         y|=(1LL<<i);
      }
      else{
         if(((1LL<<i)&r)){
            x|=(1LL<<i);
            y|=(1LL<<i);
         }
      }

      // cout<<x<<" "<<y<<"    ";
  }
  ll z=l;
  if(x==l)  z=r;
  cout<<x<<" "<<y<<" "<<z<<"\n";
}


int main()
 { 
   ios_base::sync_with_stdio(false);
   cin.tie(0); cout.tie(0);
   
   #ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
   #endif

  int T=1;
  cin>>T;
  while(T--)
  {solve();} 
 
   return 0;
    
}

Solution 2 (runtime: 77 ms):
#include <bits/stdc++.h>
using namespace std;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
// #define ordered_set tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update>

typedef long long int ll;
typedef long double ld;

const ld eps = 1e-9;
const int mod = 1000000007;
const ll inf = 1e18;
const int N1 = 2e5 + 10;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    // mt19937 rng((unsigned int)chrono::steady_clock::now().time_since_epoch().count());
    // auto start = chrono::high_resolution_clock::now();

    // code here. dont use mbinpow,binpow,right, fact and isprime as function names
    // (1/b)%M is (b^(M-2))%M

    ll tt;
    cin >> tt;
    while (tt--)
    {
        int l, r;
        cin >> l >> r;

        int k = 0;
        for(int i=0;i<30;i++){
            if((l&(1<<i))^(r&(1<<i))){
                k = i;
            }
        }

        int val1 = (r >> k) << k;
        int val2 = val1 - 1;
        int val3;
        for (int i = l; i <= min(l + 2, r);i++){
            if(i!=val1 && i!=val2){
                val3 = i;
                break;
            }
        }

        cout << val1 << " " << val2 << " " << val3 << '\n';
    }

}