ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;

void solve(){
    int n;
    cin >> n;
    vector<int> c(n);
    for (int i = 0; i < n ; i++) {
        cin >> c[i];
    }
    stack<pair<int,int>> perms;
    for (int i = 1; i < n; i++) {
        if (c[i - 1] < c[i]) {
            perms.push(make_pair(c[i - 1], c[i]));
            perms.push(make_pair(c[i], c[i - 1]));
        } else {
            int j = i;
            while (j > 0 && c[j - 1] > c[j]) {
                perms.push(make_pair(c[j - 1], c[j]));
                swap(c[j-1], c[j]);
                j--;
            }
            if (j > 0) {
                perms.push(make_pair(c[j - 1], c[j]));
                perms.push(make_pair(c[j], c[j - 1]));
            }
        }
    }
    printf("%ld\n", perms.size());
    while(!perms.empty()) {
        auto p = perms.top();
        perms.pop();
        printf("%d %d\n", p.first, p.second);
    }
}

int main (){
    cin.tie(NULL);
    solve();
    return 0;
}

Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;

void solve(){
    int n;
    cin >> n;
    vector<int> c(n);
    for (int i = 0; i < n ; i++) {
        cin >> c[i];
    }
    vector<int> trans(n + 1);
    for (int i = 0; i < n; i++) {
        trans[c[i]] = i + 1;
    }

    stack<pair<int,int>> perms;
    for (int p = 1; p < n; p++) {
        for (int i = trans[p]; i < n; i++) {
            perms.push(make_pair(p, c[i]));
        }
        for (int i = n - 1; i >= trans[p]; i--) {
            perms.push(make_pair(c[i], p));
        }
        for (int i = trans[p] - 1; i >= p; i--) {
            perms.push(make_pair(c[i - 1], c[i]));
            swap(c[i-1], c[i]);
        }
    }

    printf("%ld\n", perms.size());
    while(!perms.empty()) {
        auto p = perms.top();
        perms.pop();
        printf("%d %d\n", p.first, p.second);
    }
}

int main (){
    cin.tie(NULL);
    solve();
    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
#include <bits/stdc++.h>
using namespace std;

void solve(){
    int n;
    cin >> n;
    vector<int> c(n);
    for (int i = 0; i < n ; i++) {
        cin >> c[i];
    }
    stack<pair<int,int>> perms;
    for (int i = 1; i < n; i++) {
        if (c[i - 1] < c[i]) {
            perms.push(make_pair(c[i - 1], c[i]));
            perms.push(make_pair(c[i], c[i - 1]));
        } else {
            int j = i;
            while (j > 0 && c[j - 1] > c[j]) {
                perms.push(make_pair(c[j - 1], c[j]));
                swap(c[j-1], c[j]);
                j--;
            }
            if (j > 0) {
                perms.push(make_pair(c[j - 1], c[j]));
                perms.push(make_pair(c[j], c[j - 1]));
            }
        }
    }
    printf("%ld\n", perms.size());
    while(!perms.empty()) {
        auto p = perms.top();
        perms.pop();
        printf("%d %d\n", p.first, p.second);
    }
}

int main (){
    cin.tie(NULL);
    solve();
    return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

#define int long long

#define xyz



using namespace std;

typedef long double ld;

typedef pair<int,int> PII;

const int N = 1e5+10,mod = 1e9+7;

const int INF = (1ll<<60)-1;

int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};

int n,m;



int encode(int x,int y)

{

    return (x-1)*m+y;

}

PII decode(int x)

{

    return make_pair((x-1)/m+1,(x-1)%m+1);

}



int qmi(int a,int b)

{

    int res=1;

    while(b)

    {

        if(b&1)res=res*a%mod;

        a=a*a%mod;

        b>>=1;

    }

    return res;

}



void solve()

{

    int n;

    cin>>n;

    vector<int>a(n+2);

    for(int i=1;i<=n;i++)cin>>a[i];

    int flag=1;

    for(int i=1;i<n;i++)

    {

        if(a[i]>a[i+1])

        {

            if(i-1>0)

            {

                a[i]-=a[i-1];

                a[i-1]=0;

                if(a[i]>a[i+1])

                {

                    flag=0;

                    break;

                }

            }

        }

    }

    if(flag)cout<<"YES"<<"\n";

    else cout<<"NO"<<"\n";

}



signed main()

{

    cin.tie(nullptr);

    ios::sync_with_stdio(false);

    int T=1;

    cin>>T;

    while(T--)solve();

    return 0;

}

/*



1

1 2



*/
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

#define int long long

#define xyz



using namespace std;

typedef long double ld;

typedef pair<int,int> PII;

const int N = 1e5+10,mod = 1e9+7;

const int INF = (1ll<<60)-1;

int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};

int n,m;



int encode(int x,int y)

{

    return (x-1)*m+y;

}

PII decode(int x)

{

    return make_pair((x-1)/m+1,(x-1)%m+1);

}



int qmi(int a,int b)

{

    int res=1;

    while(b)

    {

        if(b&1)res=res*a%mod;

        a=a*a%mod;

        b>>=1;

    }

    return res;

}



void solve()

{

    int n;

    cin>>n;

    vector<int>a(n+2);

    for(int i=1;i<=n;i++)cin>>a[i];

    int flag=1;

    for(int i=1;i<n;i++)

    {

        if(a[i]>a[i+1])

        {

            if(i-1>0)

            {

                a[i]-=a[i-1];

                a[i-1]=0;

                if(a[i]>a[i+1])

                {

                    flag=0;

                    break;

                }

            }

            else

            {

                flag=0;

                break;

            }

        }

    }

    if(flag)cout<<"YES"<<"\n";

    else cout<<"NO"<<"\n";

}



signed main()

{

    cin.tie(nullptr);

    ios::sync_with_stdio(false);

    int T=1;

    cin>>T;

    while(T--)solve();

    return 0;

}

/*



1

1 2



*/



Submission (verdict: Accepted):
#include <bits/stdc++.h>

#define int long long

#define xyz



using namespace std;

typedef long double ld;

typedef pair<int,int> PII;

const int N = 1e5+10,mod = 1e9+7;

const int INF = (1ll<<60)-1;

int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};

int n,m;



int encode(int x,int y)

{

    return (x-1)*m+y;

}

PII decode(int x)

{

    return make_pair((x-1)/m+1,(x-1)%m+1);

}



int qmi(int a,int b)

{

    int res=1;

    while(b)

    {

        if(b&1)res=res*a%mod;

        a=a*a%mod;

        b>>=1;

    }

    return res;

}



void solve()

{

    int n;

    cin>>n;

    vector<int>a(n+2);

    for(int i=1;i<=n;i++)cin>>a[i];

    int flag=1;

    for(int i=1;i<n;i++)

    {

        int t=min(a[i],a[i+1]);

        a[i]-=t;

        a[i+1]-=t;

        if(a[i]>a[i+1])

        {

            flag=0;

            break;

        }

    }

    if(flag)cout<<"YES"<<"\n";

    else cout<<"NO"<<"\n";

}



signed main()

{

    cin.tie(nullptr);

    ios::sync_with_stdio(false);

    int T=1;

    cin>>T;

    while(T--)solve();

    return 0;

}

/*



1

1 2



*/
Problem: 2060D - Subtract Min Sort
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

#define int long long

#define xyz



using namespace std;

typedef long double ld;

typedef pair<int,int> PII;

const int N = 1e5+10,mod = 1e9+7;

const int INF = (1ll<<60)-1;

int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};

int n,m;



int encode(int x,int y)

{

    return (x-1)*m+y;

}

PII decode(int x)

{

    return make_pair((x-1)/m+1,(x-1)%m+1);

}



int qmi(int a,int b)

{

    int res=1;

    while(b)

    {

        if(b&1)res=res*a%mod;

        a=a*a%mod;

        b>>=1;

    }

    return res;

}



void solve()

{

    int n;

    cin>>n;

    vector<int>a(n+2);

    for(int i=1;i<=n;i++)cin>>a[i];

    int flag=1;

    for(int i=1;i<n;i++)

    {

        if(a[i]>a[i+1])

        {

            if(i-1>0)

            {

                a[i]-=a[i-1];

                a[i-1]=0;

                if(a[i]>a[i+1])

                {

                    flag=0;

                    break;

                }

            }

        }

    }

    if(flag)cout<<"YES"<<"\n";

    else cout<<"NO"<<"\n";

}



signed main()

{

    cin.tie(nullptr);

    ios::sync_with_stdio(false);

    int T=1;

    cin>>T;

    while(T--)solve();

    return 0;

}

/*



1

1 2



*/



Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>

#define int long long

#define xyz



using namespace std;

typedef long double ld;

typedef pair<int,int> PII;

const int N = 1e5+10,mod = 1e9+7;

const int INF = (1ll<<60)-1;

int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};

int n,m;



int encode(int x,int y)

{

    return (x-1)*m+y;

}

PII decode(int x)

{

    return make_pair((x-1)/m+1,(x-1)%m+1);

}



int qmi(int a,int b)

{

    int res=1;

    while(b)

    {

        if(b&1)res=res*a%mod;

        a=a*a%mod;

        b>>=1;

    }

    return res;

}



void solve()

{

    int n;

    cin>>n;

    vector<int>a(n+2);

    for(int i=1;i<=n;i++)cin>>a[i];

    int flag=1;

    for(int i=1;i<n;i++)

    {

        if(a[i]>a[i+1])

        {

            if(i-1>0)

            {

                a[i]-=a[i-1];

                a[i-1]=0;

                if(a[i]>a[i+1])

                {

                    flag=0;

                    break;

                }

            }

            else

            {

                flag=0;

                break;

            }

        }

    }

    if(flag)cout<<"YES"<<"\n";

    else cout<<"NO"<<"\n";

}



signed main()

{

    cin.tie(nullptr);

    ios::sync_with_stdio(false);

    int T=1;

    cin>>T;

    while(T--)solve();

    return 0;

}

/*



1

1 2



*/
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == batas_min ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}

Submission (verdict: Accepted):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == batas_min ? batas_max : batas_min);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = l | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == l ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = l | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == l ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}

Submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == l ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == l ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}

Submission (verdict: Compilation error):
#include "bits/stdc++.h"
using namespace std;
void solve(){
    int batas_min,batas_max;
    cin>>batas_min>>batas_max;
    int k=31- __builtin_clz(batas_min^batas_max);
    int a = batas_min | ((1 << k) - 1);
    int b = a + 1;
    int c = (a == batas_min ? batas_max : l);
    cout<<a<<" "<<b<<" "<<c<<endl;
    
}
signed main(){
    ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
    int t;
    cin>>t;
    while(t--){
        solve();
    }
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;

void solve() {
    string s;
    cin >> s;
    int n = s.length();
    for (int i = 1; i < n; i++) {
        while (s[i] != '0' && s[i - 1] < s[i]) {
            s[i] = s[i] - 1;
            s[i - 1] = s[i - 1] + 1;
        }
    }
    cout << s << endl;
}

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

Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

string solve(string s) {
    int n = s.length();
    vector<int> digits(n);
    vector<int> result(n);
    for (int i = 0; i < n; i++) {
        digits[i] = s[i] - '0';
        result[i] = digits[i];
    }
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (digits[j] != 0) {
                vector<int> temp = digits;
                temp[j] -= 1;
                swap(temp[j], temp[j - 1]);
                if (temp > result) {
                    result = temp;
                    digits = temp;
                }
            }
        }
    }
    string finalResult;
    for (int digit : result) {
        finalResult += (digit + '0');
    }
    return finalResult;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        string s;
        cin >> s;
        cout << solve(s) << endl;
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

string solve(string s) {
    int n = s.length();
    vector<int> digits(n);
    vector<int> result(n);
    for (int i = 0; i < n; i++) {
        digits[i] = s[i] - '0';
        result[i] = digits[i];
    }
    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            if (digits[j] != 0) {
                vector<int> temp = digits;
                temp[j] -= 1;
                swap(temp[j], temp[j - 1]);
                if (temp > result) {
                    result = temp;
                    digits = temp;
                }
            }
        }
    }
    string finalResult;
    for (int digit : result) {
        finalResult += (digit + '0');
    }
    return finalResult;
}

int main() {
    int t;
    cin >> t;
    while (t--) {
        string s;
        cin >> s;
        cout << solve(s) << endl;
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;

void solve() {
    string s; cin >> s;
    for (int i = 0; i < s.size(); i++) {
        int best = s[i] - '0', pos = i;
        for (int j = i; j < min(i + 10, (int) s.size()); j++) {
            if (s[j] - '0' - (j - i) > best) {
                best = s[j] - '0' - (j - i);
                pos = j;
            }
        }
        while (pos > i) {
            swap(s[pos], s[pos - 1]);
            pos--;
        }
        s[i] = char(best + '0');
    }
    cout << s << "\n";
}

int main() {
    int t; cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2050D - Digital string maximization
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;

void solve() {
    string s;
    cin >> s;
    int n = s.length();
    for (int i = 1; i < n; i++) {
        while (s[i] != '0' && s[i - 1] < s[i]) {
            s[i] = s[i] - 1;
            s[i - 1] = s[i - 1] + 1;
        }
    }
    cout << s << endl;
}

int main() {
    int t;  cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: Python 3


Submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1:
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)
Problem: 2057C - Trip to the Olympiad
Language: Python 3

Previous submission (verdict: Wrong answer on test 1):
t=int(input())
for ii in range (0,t):
    l, r = map(int, input().split())
    k = 0
    bin_l = bin(l)[2:].zfill(32)
    bin_r = bin(r)[2:].zfill(32)
    for i in range(31, -1, -1):
        if bin_l[i] != bin_r[i]:
            k = 31 - i
            break
    mask = (1 << k) - 1
    a = mask | l
    b = a + 1
    c = r if a == l else l
    print(a, b, c)




Submission (verdict: Accepted):
t=int(input())
for ii in range (0,t):
    l, r = map(int, input().split())
    k = 0
    for i in range(30, -1, -1):
        if ((l >> i) & 1) ^ ((r >> i) & 1):
            k = i
            break
    a = (1 << k) - 1 | l
    b = a + 1
    c = r if a == l else l
    print(a, b, c)
Problem: 2057C - Trip to the Olympiad
Language: Python 3

Previous submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1 or (l*2==2**t and c+2**t<r):
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)



Submission (verdict: Wrong answer on test 1):
t=int(input())
for ii in range (0,t):
    l, r = map(int, input().split())
    k = 0
    bin_l = bin(l)[2:].zfill(32)
    bin_r = bin(r)[2:].zfill(32)
    for i in range(31, -1, -1):
        if bin_l[i] != bin_r[i]:
            k = 31 - i
            break
    mask = (1 << k) - 1
    a = mask | l
    b = a + 1
    c = r if a == l else l
    print(a, b, c)
Problem: 2057C - Trip to the Olympiad
Language: Python 3

Previous submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1 or l*2==2**t:
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)



Submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1 or (l*2==2**t and c+2**t<r):
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)
Problem: 2057C - Trip to the Olympiad
Language: Python 3

Previous submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1:
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)



Submission (verdict: Wrong answer on test 2):
t=int(input())
for ii in range (0,t):
    l,r=list(map(int, input().split()))
    c=0
    sr=bin(r)[2:]
    t =len(sr) - 1
    sl=bin(l)[2:]
    k=len(sl)-1
    sl="0"*(t-k)+sl
    n=t
    while t>=0:
        d=n-t
        e=int(sr[d]) + int(sl[d])
        if e==1 or e==2:
            if c+2**t<=l+1 or l*2==2**t:
                c+=2**t
        else:
            if c+2**t<r:
                c+=2**t
        t-=1
    print(l,r,c)