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

Code 1:
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace chrono;

using namespace __gnu_pbds;


template<typename T>
using orderedSet = tree<T , null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template<typename T>
using orderedMultiset = tree<T , null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
// find_by_order(k) -> iterator at k
// order_of_key(k) -> number of items that are strictly smaller than k


#define FASTIO() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define MOD1 1000000007
#define MOD9 998244353
#define INF 1e9
#define INF1 1e18
#define endl "\n"
#define pb push_back
#define ppb pop_back
#define ff first
#define ss second
#define PI 3.141592653589793238462
#define set_bits __builtin_popcountll
#define all(x) (x).begin(), (x).end()
#define lb lower_bound
#define ub upper_bound
#define fcout cout<<fixed<<setprecision(10)
#define YES  cout<<"YES"<<endl
#define NO cout<<"NO"<<endl

typedef long long ll;
typedef unsigned long long ull;
typedef long double lld;

// ---------------------------------- DEFINES ---------------------------------------
typedef vector <int> vi;
typedef vector <ll> vll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vector <int> > vvi;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
template<typename T> using PQ = priority_queue<T>;
template<typename T> using QP = priority_queue<T, vector<T>, greater<T>>;
// ----------------------------------------------------------------------------------

// ---------------------------------- OPERATOR OVERLOADING ---------------------------------------
template<typename T>
istream& operator>>(istream &istream, vector<T> &v) {for (auto &x : v)cin >> x; return istream;}
template<typename T>
ostream& operator<<(ostream &ostream, const vector<T> &v) { for (auto &x : v) cout << x << " "; return ostream; }
template<typename T1, typename T2>
istream& operator>>(istream &istream, pair<T1, T2> &p) { return (istream >> p.ff >> p.ss); }
template<typename T1, typename T2>
ostream& operator<<(ostream &ostream, const pair<T1, T2> &p) { return (ostream << p.ff << " " << p.ss); }
template<typename T1, typename T2>
istream& operator>>(istream &istream, vector<pair<T1, T2>> &v) {for (auto &x : v)cin >> x; return istream;}
template<typename T1, typename T2>
ostream& operator<<(ostream &ostream, const vector<pair<T1, T2>> &v) { for (auto &x : v) cout << x << endl; return ostream; }
template<typename T>
istream& operator>>(istream &istream, vector<vector<T>> &v) {for (auto &x : v)cin >> x; return istream;}
template<typename T>
ostream& operator<<(ostream &ostream, const vector<vector<T>> &v) { for (auto &x : v) cout << x << endl; return ostream; }
// ------------------------------------------------------------------------------------------------


// ------------------------------------------ DEBUG ------------------------------------------------
#ifndef ONLINE_JUDGE
#define debug(x...) cerr <<__func__<<":"<<__LINE__<<" [" << #x << "] = "; _print(x); cerr << endl;
#define HERE cerr <<__func__<<":"<<__LINE__<<" [ here ] "; cerr << endl;
#else
#define debug(x...)
#endif

void _print(ll t) {cerr << t;}
void _print(int t) {cerr << t;}
void _print(string t) {cerr << t;}
void _print(char t) {cerr << t;}
void _print(lld t) {cerr << t;}
void _print(double t) {cerr << t;}
void _print(ull t) {cerr << t;}

template <class T, class V> void _print(pair <T, V> p) {cerr << "{"; _print(p.ff); cerr << ","; _print(p.ss); cerr << "}";}
template <class T> void _print(vector <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(set <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(multiset <T> v) {cerr << "[ "; for (T i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T, class V> void _print(map <T, V> v) {cerr << "[ "; for (auto i : v) {_print(i); cerr << " ";} cerr << "]";}
template <class T> void _print(vector <vector <T> > v) {cerr << "{ "; for (vector<T> i : v) {cerr << "[ "; for (T j : i) {_print(j); cerr << " ";}; cerr << "] ";} cerr << "}";}
template <class T, class V> void _print(vector < pair <T , V> > vp) {cerr << "{ "; for (pair<T, V> i : vp) {cerr << "[ "; "{"; _print(i.ff); cerr << ","; _print(i.ss); cerr << " ] ";} cerr << "}";}
template <class T> void _print(stack <T> st) {cerr << "[ "; while (!st.empty()) {_print(st.top()); st.pop(); cerr << " ";} cerr << "]";}
template <class T> void _print(queue <T> q) {cerr << "[ "; while (!q.empty()) {_print(q.front()); q.pop(); cerr << " ";} cerr << "]";}
template <class T> void _print(deque <T> dq) {cerr << "[ "; while (!dq.empty()) {_print(dq.front()); dq.pop_front(); cerr << " ";} cerr << "]";}
template <class T> void _print(PQ <T> pq) {cerr << "[ "; while (!pq.empty()) {_print(pq.top()); pq.pop(); cerr << " ";} cerr << "]";}
template <class T> void _print(QP <T> pq) {cerr << "[ "; while (!pq.empty()) {_print(pq.top()); pq.pop(); cerr << " ";} cerr << "]";}
//---------------------------------------------------------------------------------------------------

void solve() {

    //solution starts from here
    ll l, r;
    cin >> l >> r;
    int mx = 0;
    for (int i = 0; i < 32; i++) {
            if ((r & (1LL << i)) && (l & (1LL << i)) == 0) mx = i;
    }
    int a = 0;
    for (int i = mx; i < 32; i++) {
            a |= ((1LL << i) & r);
    }
    if (r >= a + 1) {
            cout << a << " " << a + 1 << " " << a - 1 << endl;
            debug((a^(a+1)) + ((a+1)^(a-1)) + ((a-1)^a))
    }
    else {
        cout << a << " " << a - 1 << " " << a - 2 << endl;
        debug((a^(a-1)) + ((a-1)^(a-2)) +((a-2)^(a)))

    }
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("error.txt", "w", stderr);
#endif

    FASTIO();
    auto start1 = high_resolution_clock::now();
    int t = 1;
    cin >> t;
    int T = t;
    while (t--)
    {
       #ifndef ONLINE_JUDGE
        cerr<<"Test "<<(T-t)<<" :"<<endl;
       #endif   
       solve();
       #ifndef ONLINE_JUDGE
        cerr<<"--------------------------"<<endl<<endl;
       #endif   
    }
    auto stop1 = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop1 - start1);
#ifndef ONLINE_JUDGE
    cerr << "Time elapsed : " << (duration . count() / 1000000) << '.' << (duration . count() % 1000000) << endl;
#endif

}

Code 2:
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int test = sc.nextInt();
		for (int z = 0; z < test; z++) {

			long l = sc.nextInt();
			long r = sc.nextInt();
			long one = l;
			long two;
			long three;
			long i =1;
			if((r-l+1)==3) {
				two=l+1;
				three=l+2;
			} else {
				while (i<=r) {
					i=i*2;
				}
				if(i/2<=l){
				    if((r-l+1) >=6 ){
				        two= r-3;
				        three=r;
				        
				        
				    }else{
				        two= r-1;
				        three= r;
				        one = r-2;
				    }
				    
				}
				else{
				    three=i/2;
				    two=three-1;
				}
				
			}
			
			System.out.println(one+" "+two+" "+three);



		}
	}
}

Answer: 2