Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define vii vector<vector<int>>
#define pb push_back
#define endl '\n'
#define fora(a) for(auto i:a)cout<<i<< ' ';cout<<endl
#define form(a) for(auto i:a)cout<<i.first<< ' '<<i.second<<endl
#define maxc(i) *max_element(i.begin(),i.end())
#define minc(i) *min_element(i.begin(),i.end())
#define All(i) i.begin(),i.end()
#define Rall(i) i.rbegin(),i.rend()
#define INF (long long) 1.01e18
#define MOD 1000000007
#define fastio() ios_base::sync_with_stdio(false);cin.tie(0)

//-------------------------------PREPROCESSORS-------------------------------------

class SegmentTree {
    vector<int> tree, lazy;
    int n;

public:
    SegmentTree(int size) {
        n = size;
        tree.resize(4 * n, 0);
        lazy.resize(4 * n, 0);
    }

    void build(vector<int>& arr, int start, int end, int node) {
        if (start == end) {
            tree[node] = arr[start];
            return;
        }

        int mid = (start + end) / 2;
        build(arr, start, mid, 2 * node + 1);
        build(arr, mid + 1, end, 2 * node + 2);
        tree[node] = tree[2 * node + 1] + tree[2 * node + 2];
    }

    void updateRange(int start, int end, int l, int r, int value, int node) {
        if (lazy[node] != 0) {
            tree[node] += (end - start + 1) * lazy[node];
            if (start != end) {
                lazy[2 * node + 1] += lazy[node];
                lazy[2 * node + 2] += lazy[node];
            }
            lazy[node] = 0;
        }

        if (start > end || start > r || end < l) {
            return;
        }

        if (start >= l && end <= r) {
            tree[node] += (end - start + 1) * value;
            if (start != end) {
                lazy[2 * node + 1] += value;
                lazy[2 * node + 2] += value;
            }
            return;
        }

        int mid = (start + end) / 2;
        updateRange(start, mid, l, r, value, 2 * node + 1);
        updateRange(mid + 1, end, l, r, value, 2 * node + 2);
        tree[node] = tree[2 * node + 1] + tree[2 * node + 2];
    }

    int queryRange(int start, int end, int l, int r, int node) {
        if (start > end || start > r || end < l) {
            return 0;
        }

        if (lazy[node] != 0) {
            tree[node] += (end - start + 1) * lazy[node];
            if (start != end) {
                lazy[2 * node + 1] += lazy[node];
                lazy[2 * node + 2] += lazy[node];
            }
            lazy[node] = 0;
        }

        if (start >= l && end <= r) {
            return tree[node];
        }

        int mid = (start + end) / 2;
        int left = queryRange(start, mid, l, r, 2 * node + 1);
        int right = queryRange(mid + 1, end, l, r, 2 * node + 2);
        return left + right;
    }

    void updateRange(int l, int r, int value) {
        updateRange(0, n - 1, l, r, value, 0);
    }

    int queryRange(int l, int r) {
        return queryRange(0, n - 1, l, r, 0);
    }
};

class Manacher {
public:
    string longestPalindrome(string s) {
        string t="$";
        for(char i: s){
            t+='#';
            t+=i;
        }
        t+="#@";
        int n=t.size();
        int main_palindrome_center=1, main_palindrome_right_bound=1;
        vector<int> palindrome_length(n,0);
        for(int i=1;i<n;i++){

            // finding mirror index
            // let say main_palindrome_center as c, (i-c) => gives difference then reduce that from c which makes c-(i-c)
            // c-i+c => 2*c -i
            int mirror_character_index= main_palindrome_center*2 - i; 

            if(i< main_palindrome_right_bound){
                // if i is inside the boundary, then atleast guarentee length should be
                // palindrome_length of mirror but it may exceeds the right boundary
                // so remove the string beyond the right boundary by
                palindrome_length[i]= min(
                    palindrome_length[mirror_character_index],
                    main_palindrome_right_bound-i);
            }

            while( 
                t[i + (palindrome_length[i]+1)] == t[i- (palindrome_length[i]+1)]
            ){
                palindrome_length[i]++;
            }

            if((i+ palindrome_length[i]) > main_palindrome_right_bound){
                main_palindrome_right_bound = palindrome_length[i]+i;
                main_palindrome_center = i;
            }
        }
        int max_length=0, index=0;
        for(int i=1;i<n;i++){
            if(max_length<=palindrome_length[i]){
                max_length= palindrome_length[i];
                index=i;
            }
        }
        string longest_palindrome_string="";
        for(int i=index-max_length;i<index+max_length;i++){
            if(t[i]=='#')continue;
            longest_palindrome_string+=t[i];

        }

        return longest_palindrome_string;
    }
    // watch this video, if you have doubts https://www.youtube.com/watch?v=nbTSfrEfo6M
};


int bpow(int a,int b){
    int res=1;
    while(b>0){
        if(b&1)
            res=res%MOD*1ll*(a%MOD)%MOD;
        a=a%MOD*1ll*(a%MOD)%MOD;
        b>>=1;
    }
    return res;
}
template <typename T>
T nxt() {
    T x;
    cin >> x;
    return x;
}

void solve(){
  int l,r;
  cin>>l>>r;
  int k= 31- __builtin_clz(r);
  int a= 1<<k, b= a-1, c= (b==l)? r: l;
  cout<<a<<" "<<b<<" "<<c<<endl;

}



signed main() {
    fastio();
    int test=1;
    cin>>test;
    for(int i=1;i<=test;i++){
      // cout<<"case #"<<i<<": ";
      solve();
    }

    return 0;
}