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

Solution 1 (runtime: 77 ms):
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define rep(i ,a ,b) for(int i =a;i<=b;++i)
#define endl '\n'
#define debug(a) cout<<#a<<'='<<a<<endl;
#define inf 0x3f3f3f3f
#define ls u<<1
#define rs u<<1|1
typedef pair<int,int> pii;
int ksm(int a , int b){
	int res = 1;
	while(b){
		if(b&1) res = res * a ;
		b >>= 1;
		a = a * a ;
	}
	return res;
}
void solve(){
   int l , r;
   cin>>l>>r;
   int cnt = 0;

   if(r - l == 2){
    cout<<l<<' '<<l+1<<' '<<l+2<<endl;
    return;
   }
   int ans = 0;
   while(1){
    int x = 1;
    while(x*2 <= r)x *=2;
    if(x <=l){
        ans +=x;
        r -=x;
        l -=x;
        continue;
    }
    if(x == r)cout<<x + ans<<' '<<x + ans-1<<' '<<l+ans<<endl;
    else cout<<x + ans<<' '<<x + ans-1<<' '<<r+ans<<endl;
    return;
    

   }
 
  
}
 
 
signed main(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    int _ = 1;
    cin>>_; 
    while(_--)solve();
    return 0;
}

Solution 2 (runtime: 124 ms):
#include<bits/stdc++.h>
using namespace std;
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define e '\n'
#define pb push_back
#define yes "yes"
#define no "no"
#define F first
#define S second
//#define srt(a) sort(a,a+n)
//#define srt(v) s5ort(v.begin(),v.end())
//#define srt(u) sort(u.begin(),u.end())
#define loop  for(i=1;i<=n;i++)
const int mod=1e9+7;
const int MOD=998244353;
const int lx=1e5+25;
//pair<ll,ll>p[222222];
//map<ll,ll>mp;
//typedef pair<int, int> pi;
//sort(p,p+n,greater<pair<ll,ll>>());-sort vector pair decending order
//priority_queue<pi,vector<pi>,greater<pi>>pq;
//priority_queue<int,vector<int>,greater<int>>pq;-minheap
//priority_queue<pair<int,int>>pq;
//s.erase(position,length)

void solve(){
    ll l, r, c1=0;
    cin>>l>>r;

    vector<ll>v, v1, v2, v3;
    for(int i=0; i<=30; i++){
        v.pb(pow(2,i));
    }

    ll a, b, c, n = v.size();
    a = r;
    map<ll,ll>mp;
    for(int i=n-1; i>=0; i--){
        if(a >= v[i]){
            v1.pb(1);
            a-=v[i];
            mp[v[i]]++;
        }
        else
            v1.pb(0);
    }
    b = l, c1=0;
    for(int i=n-1; i>=0; i--){
        if(b >= v[i]){
            v2.pb(1);
            b-=v[i];
            mp[v[i]]++;
        }
        else
            v2.pb(0);
    }
    a = 0, b = 0;
    reverse(v.begin(), v.end());
    for(int i=0; i<v1.size(); i++){
        if(v1[i] == v2[i]){
            if(v1[i] == 1)
                a+=v[i], b+=v[i];
        }
        else{
            a+=v[i], b+=(v[i]-1);
            break;
        }
    }

//    for(int i=0; i<v1.size(); i++)
//        cout<<v1[i]<<" "<<" "<<v2[i]<<e;;

    if(r>a)
        c = a+1;
    else
        c = b-1;

    cout<<a<<" "<<b<<" "<<c<<e;
}



int main(){
    fast()
    int test;
    cin>>test;
    while(test--){
        solve();
    }
    return 0;
}

//        **Number Theory***

//        sort(a+1,a+n+1);
//        long long gcd=a[1];
//        for(int i=2;i<=n;i++){
//             gcd = __gcd(a[i],gcd);
//        }
//         cout<<gcd<<endl;

//        long long s[10];
//        for(i=1;i<10;i++)
//            s[i]=i;
//        s[1]=2;
//        for(i=2;i<10;i++){
//            q=s[i]*s[i-1];
//            long long gcd = __gcd(s[i],s[i-1]);
//            s[i]=q/gcd;//   -LCM
//        }
//        for(i=1;i<10;i++)
//            cout<<s[i]<<" ";
//        *Linear Diophantine Equations
//        1.ax+by=c
//        there will be a solution if gcd(a,b) can divide c

//        convert string to int and int to string
//        string t;
//        cin>>n;
//        p=stoi(t);
//        std:: string s = std::to_string(n);
//        cout<<s;
//        build all permutation of a string
//        string s="1234";
//        do {
//            std::cout<<s<<std::endl;
//        } while (std::next_permutation(s.begin(),s.end()));


//    Harmonic series-nlogn
//    for(i=1;i<=n;i++){
//        for(j=i;j<=n;j+=i)
//            operation.....
//    }