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

Previous submission (verdict: Wrong answer on test 1):
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;

#define ll long long
#define forn(i, s, n) for (int i = s; i < n; i++)
#define bforn(i, s) for (int i = s; i >= 0; i--)
// for pairs
#define s second
#define f first 
const int M = 2e5 + 1;
const char nl = '\n';

void solve(){
    ll l, r; cin >> l >> r;
    int k = 0;
    int at = 0;
    while (true) {
        if (r / (1 << at) == 0) {
            break;
        }
        if ((l >> at) % 2 != (r >> at) % 2) {
            k = at;
        }
        at++;
    }
    ll a = (l | ((1 << k) - 1));
    ll b = a + 1, c = (a == r) ? l : r;
    cout << a << ' ' << b << ' ' << c << nl;;
}
// if you are unsure of how to do a problem by hand
// the solution is most likely somewhat brute force (i.e binsearch)
// if input is limited to 0-9 or a-z, usually you will loop through all combinations
// of letters or numbers
// constructive problems : start with 1 when constructing
// :%y+ to copy all lines
// rearrange math expressions
// difference array? (a[i] - b[i])
// debugging : reread the problem statement-every word is important!
// debugging : print important variables!
// think brute force sol first
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t; cin >> t;
    for (int tt = 0; tt < t; tt++) solve();
}




Submission (verdict: Accepted):
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <vector>
using namespace std;

#define ll long long
#define forn(i, s, n) for (int i = s; i < n; i++)
#define bforn(i, s) for (int i = s; i >= 0; i--)
// for pairs
#define s second
#define f first 
const int M = 2e5 + 1;
const char nl = '\n';

void solve(){
    ll l, r; cin >> l >> r;
    int k = 0;
    int at = 0;
    while (true) {
        if (r / (1 << at) == 0) {
            break;
        }
        if ((l >> at) % 2 != (r >> at) % 2) {
            k = at;
        }
        at++;
    }
    ll a = (l | ((1 << k) - 1));
    ll b = a + 1, c = (b == r) ? l : r;
    cout << a << ' ' << b << ' ' << c << nl;;
}
// if you are unsure of how to do a problem by hand
// the solution is most likely somewhat brute force (i.e binsearch)
// if input is limited to 0-9 or a-z, usually you will loop through all combinations
// of letters or numbers
// constructive problems : start with 1 when constructing
// :%y+ to copy all lines
// rearrange math expressions
// difference array? (a[i] - b[i])
// debugging : reread the problem statement-every word is important!
// debugging : print important variables!
// think brute force sol first
int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int t; cin >> t;
    for (int tt = 0; tt < t; tt++) solve();
}