ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

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

int dp[1001][1001];
int dfs(int i, int j, string &a, string &b, string &c) {
    if (i + j >= c.size()) {
        return 0;
    }
    
    if (dp[i][j] != -1) {
        return dp[i][j];
    }
    
    int first = 1e9;
    if (a[i] == c[i + j]) {
        first = min(first, dfs(i + 1, j, a, b, c));
    } else {
        first = min(first, 1 + dfs(i + 1, j, a, b, c));
    }
    
    int second = 1e9;
    if (b[j] == c[i + j]) {
        second = min(second, dfs(i, j + 1, a, b, c));
    } else {
        second = min(second, 1 + dfs(i, j + 1, a, b, c));
    }
    
    return dp[i][j] = min(first, second);
}

void accept_it() {
    string a, b, c;
    cin >> a >> b >> c;
    
    memset(dp, -1, sizeof(dp));
    int res = dfs(0, 0, a, b, c);
    
    cout << res << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        accept_it();
    }

    return 0;
}

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

int dp[1001][1001];

int dfs(int i, int j, string &a, string &b, string &c) {
    if (i + j >= c.size()) {
        return 0;
    }
    
    if (dp[i][j] != -1) {
        return dp[i][j];
    }
    
    int first = 1e9;
    if (a[i] == c[i + j]) {
        first = dfs(i + 1, j, a, b, c);
    } else {
        first = 1 + dfs(i + 1, j, a, b, c);
    }
    
    int second = 1e9;
    if (b[j] == c[i + j]) {
        second = dfs(i, j + 1, a, b, c);
    } else {
        second = 1 + dfs(i, j + 1, a, b, c);
    }
    
    return dp[i][j] = min(first, second);
}

void accept_it() {
    string a, b, c;
    cin >> a >> b >> c;
    
    memset(dp, -1, sizeof(dp));
    int res = dfs(0, 0, a, b, c);
    
    cout << res << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        accept_it();
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)


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

int dp[1001][1001];
int dfs(int i, int j, string &a, string &b, string &c) {
    if (i + j >= c.size()) {
        return 0;
    }
    
    if (dp[i][j] != -1) {
        return dp[i][j];
    }
    
    int first = 1e9;
    if (a[i] == c[i + j]) {
        first = min(first, dfs(i + 1, j, a, b, c));
    } else {
        first = min(first, 1 + dfs(i + 1, j, a, b, c));
    }
    
    int second = 1e9;
    if (b[j] == c[i + j]) {
        second = min(second, dfs(i, j + 1, a, b, c));
    } else {
        second = min(second, 1 + dfs(i, j + 1, a, b, c));
    }
    
    return dp[i][j] = min(first, second);
}

void accept_it() {
    string a, b, c;
    cin >> a >> b >> c;
    
    memset(dp, -1, sizeof(dp));
    int res = dfs(0, 0, a, b, c);
    
    cout << res << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        accept_it();
    }

    return 0;
}
Problem: 2050E - Three Strings
Language: C++20 (GCC 13-64)

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

int dp[1001][1001];

int dfs(int i, int j, string &a, string &b, string &c) {
    if (i + j >= c.size()) {
        return 0;
    }
    
    if (dp[i][j] != -1) {
        return dp[i][j];
    }
    
    int first = 1e9;
    if (a[i] == c[i + j]) {
        first = dfs(i + 1, j, a, b, c);
    } else {
        first = 1 + dfs(i + 1, j, a, b, c);
    }
    
    int second = 1e9;
    if (b[j] == c[i + j]) {
        second = dfs(i, j + 1, a, b, c);
    } else {
        second = 1 + dfs(i, j + 1, a, b, c);
    }
    
    return dp[i][j] = min(first, second);
}

void accept_it() {
    string a, b, c;
    cin >> a >> b >> c;
    
    memset(dp, -1, sizeof(dp));
    int res = dfs(0, 0, a, b, c);
    
    cout << res << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        accept_it();
    }

    return 0;
}

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

int dp[1001][1001];

int dfs(int i, int j, string &a, string &b, string &c) {
    if (i + j == c.size()) {
        return 0;
    }
    
    if (i + j >= c.size()) {
        return 1e9;
    }
    
    if (dp[i][j] != -1) {
        return dp[i][j];
    }
    
    int first = 1e9;
    if (a[i] == c[i + j]) {
        first = dfs(i + 1, j, a, b, c);
    } else {
        first = 1 + dfs(i + 1, j, a, b, c);
    }
    
    int second = 1e9;
    if (b[j] == c[i + j]) {
        second = dfs(i, j + 1, a, b, c);
    } else {
        second = 1 + dfs(i, j + 1, a, b, c);
    }
    
    return dp[i][j] = min(first, second);
}

void accept_it() {
    string a, b, c;
    cin >> a >> b >> c;
    
    memset(dp, -1, sizeof(dp));
    int res = dfs(0, 0, a, b, c);
    
    cout << res << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    while (t--) {
        accept_it();
    }

    return 0;
}
Problem: 2052A - Adrenaline Rush
Language: C++17 (GCC 7-32)


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

#ifndef LOCAL
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#endif
#define COPYRIGHT "Copyright (c) 2024 ,yzn. All rights Reserved."
#define longbi xjn
#define AUTHOR yzn
#define YEAR 2025
#define kzn yzn

#define inf (1ll<<60)

#define fori(i, n) for (int i = 1; i <= n; i++)
#define ford(i, n,m) for (int i = n; i > m; i--)

#define ll long long
#define int ll

#define clr(n,m) for(int i=0;i<=m;i++)n[i]=0;
#define sinf(n,m) for(int i=0;i<=m;i++)n[i]=inf;

#define vi vector<int>
#define pi pair<int, int>
#define vpi vector<pair<int, int>>
#define fi first
#define se second

constexpr double eps=1e-6;
constexpr bool debug=0;
#define ID if(debug)
char abt[] = { 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' };
using namespace std;
namespace IO{
	char ibuf[(1<<20)+1],*iS,*iT;
	#ifndef LOCAL
	#define gh() (iS==iT?iT=(iS=ibuf)+fread(ibuf,1,(1<<20)+1,stdin),(iS==iT?EOF:*iS++):*iS++)
 	#else
	#define gh() getchar()
	#endif
	inline long long read(){char ch=gh();long long x=0;bool t=0;while(ch<'0'||ch>'9')   t|=ch=='-',ch=gh();while(ch>='0'&&ch<='9') x=x*10+(ch^48),ch=gh();return t?-x:x;}
	inline void write(int x){static int sta[35];int top = 0;do{sta[top++] = x % 10, x /= 10;} while (x);while (top)putchar(sta[--top] + 48);}
	const void File(bool b1,bool b2){if(b1)freopen("out.out","w",stdout);if(b2)freopen("in.in","r",stdin);}
	void YN(bool b){if(b)puts("Yes");else puts("No");}
}
using namespace IO;
const int N=1e3+5;
int n,A[N];
/*
冒泡排序...没有交换的对子互相交换一下.
*/
vector<pi>opt;
signed main()
{
    n=read();
    for(int i=1;i<=n;i++)A[i]=read();
    for(int i=1;i<n;i++){
        if(A[i]<A[i+1])opt.push_back({A[i+1],A[i]}),opt.push_back({A[i],A[i+1]});
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<n;j++){
            if(A[j]>A[j+1])opt.push_back({A[j],A[j+1]}),swap(A[j],A[j+1]);
        }
    }
    cout<<opt.size()<<endl;
    for(pi j:opt)cout<<j.first<<' '<<j.second<<endl;
}
//standard template
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

typedef long long ll;

using namespace std;

const int N = 2e5+10;



int t;

int n;

ll a[N];

int main() {

cin >> t;

while (t--) {

cin >> n;

for (int i = 0; i < n; i++) {

cin >> a[i];

}

int f = 1;

for (int i = 0; i < n-1; i += 2) {

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

f = 0;

cout << "NO";

break;

}

}

if (f)cout << "YES";

cout << '\n';



}



return 0;

}

Submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

typedef long long ll;

using namespace std;

const int N = 2e5+10;



int t;

int n;

ll a[N];

int main() {

cin >> t;

while (t--) {

cin >> n;

for (int i = 0; i < n; i++) {

cin >> a[i];

}

int f = 1;

for (int i = 0; i < n-1;i++) {

if (a[i] < a[i + 1]) {

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

a[i] = 0;

}

}

for (int i = 0; i < n-1; i++) {

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

f = 0;

break;

}

}

if (f)cout << "YES";

else cout << "NO";

cout << '\n';

}



return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

typedef long long ll;

using namespace std;

const int N = 2e5+10;



int t;

int n;

ll a[N];

int main() {

cin >> t;

while (t--) {

cin >> n;

for (int i = 0; i < n; i++) {

cin >> a[i];

}

int f = 1;

for (int i = 0; i < n-1;i++) {

if (a[i] < a[i + 1]) {

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

a[i] = 0;

}

}

for (int i = 0; i < n-1; i++) {

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

f = 0;

break;

}

}

if (f)cout << "YES";

else cout << "NO";

cout << '\n';

}



return 0;

}

Submission (verdict: Accepted):
#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

typedef long long ll;

using namespace std;

const int N = 2e5+10;



int t;

int n;

ll a[N];

int main() {

cin >> t;

while (t--) {

cin >> n;

for (int i = 0; i < n; i++) {

cin >> a[i];

}

int f = 1;

for (int i = 0; i < n-1;i++) {

if (a[i] <= a[i + 1]) {

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

a[i] = 0;

}

}

for (int i = 0; i < n-1; i++) {

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

f = 0;

break;

}

}

if (f)cout << "YES";

else cout << "NO";

cout << '\n';

}



return 0;

}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<iostream>

#include<algorithm>

#include<queue>

#include<vector>

typedef long long ll;

using namespace std;

const int N = 2e5+10;



int t;

int n;

ll a[N];

int main() {

cin >> t;

while (t--) {

cin >> n;

for (int i = 0; i < n; i++) {

cin >> a[i];

}

int f = 1;

for (int i = 0; i < n-1; i += 2) {

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

f = 0;

cout << "NO";

break;

}

}

if (f)cout << "YES";

cout << '\n';



}



return 0;

}
Problem: 2057B - Gorilla and the Exam
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <bits/algorithmfwd.h>

using namespace std;

template <typename K, typename V>
std::vector<std::pair<K, V>> sortMapByValue(const std::map<K, V> &mp) {
    std::vector<std::pair<K, V>> vec(mp.begin(), mp.end());

    std::sort(vec.begin(), vec.end(), [](const auto &a, const auto &b) {
        return a.second < b.second; // Sort in ascending order by value
    });

    return vec;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> v;
        for(int i = 0; i < n; i++){
            int x;
            cin >> x;
            v.push_back(x);
        }


    
    std::map<int, int> values;

    for(int i=0; i<n; i++){
        values[v[i]]++;
    }
    int res=0;
   auto v2=sortMapByValue(values);
    for(int i=0; i<v2.size(); i++){
        k=k-v2[i].second;
        if(k<=0){
            
            break;
        }
        res++;
    
     
    }
    cout<<res<<endl;
    }
}


Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

template <typename K, typename V>
std::vector<std::pair<K, V>> sortMapByValue(const std::map<K, V> &mp) {
    std::vector<std::pair<K, V>> vec(mp.begin(), mp.end());

    std::sort(vec.begin(), vec.end(), [](const auto &a, const auto &b) {
        return a.second < b.second; // Sort in ascending order by value
    });

    return vec;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> v;
        for(int i = 0; i < n; i++){
            int x;
            cin >> x;
            v.push_back(x);
        }


    
    std::map<int, int> values;

    for(int i=0; i<n; i++){
        values[v[i]]++;
    }
    int res=0;
   auto v2=sortMapByValue(values);
    for(int i=0; i<v2.size(); i++){
        k=k-v2[i].second;
        if(k<=0){
            
            break;
        }
        res++;
    
     
    }
    cout<<res+1<<endl;
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <bits/algorithmfwd.h>

using namespace std;

template <typename K, typename V>
std::vector<std::pair<K, V>> sortMapByValue(const std::map<K, V> &mp) {
    std::vector<std::pair<K, V>> vec(mp.begin(), mp.end());

    std::sort(vec.begin(), vec.end(), [](const auto &a, const auto &b) {
        return a.second < b.second; // Sort in ascending order by value
    });

    return vec;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> v;
        for(int i = 0; i < n; i++){
            int x;
            cin >> x;
            v.push_back(x);
        }


    
    std::map<int, int> values;

    for(int i=0; i<n; i++){
        values[v[i]]++;
    }
    int res=0;
   auto v2=sortMapByValue(values);
    for(int i=0; i<v2.size(); i++){
        k=k-v2[i].second;
        if(k<=0){
            
            break;
        }
        res++;
    
     
    }
    cout<<res<<endl;
    }
}
Problem: 2057B - Gorilla and the Exam
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Wrong answer on test 1):
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

template <typename K, typename V>
std::vector<std::pair<K, V>> sortMapByValue(const std::map<K, V> &mp) {
    std::vector<std::pair<K, V>> vec(mp.begin(), mp.end());

    std::sort(vec.begin(), vec.end(), [](const auto &a, const auto &b) {
        return a.second < b.second; // Sort in ascending order by value
    });

    return vec;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> v;
        for(int i = 0; i < n; i++){
            int x;
            cin >> x;
            v.push_back(x);
        }


    
    std::map<int, int> values;

    for(int i=0; i<n; i++){
        values[v[i]]++;
    }
    int res=0;
   auto v2=sortMapByValue(values);
    for(int i=0; i<v2.size(); i++){
        k=k-v2[i].second;
        if(k<=0){
            
            break;
        }
        res++;
    
     
    }
    cout<<res+1<<endl;
    }
}


Submission (verdict: Accepted):
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>

using namespace std;

template <typename K, typename V>
std::vector<std::pair<K, V>> sortMapByValue(const std::map<K, V> &mp) {
    std::vector<std::pair<K, V>> vec(mp.begin(), mp.end());

    std::sort(vec.begin(), vec.end(), [](const auto &a, const auto &b) {
        return a.second < b.second; // Sort in ascending order by value
    });

    return vec;
}

int main()
{
    int t;
    cin >> t;
    while(t--){
        int n, k;
        cin >> n >> k;
        vector<int> v;
        for(int i = 0; i < n; i++){
            int x;
            cin >> x;
            v.push_back(x);
        }


    
    std::map<int, int> values;

    for(int i=0; i<n; i++){
        values[v[i]]++;
    }
    int res=0;
   auto v2=sortMapByValue(values);
    for(int i=0; i<v2.size(); i++){

        if(k>=v2[i].second){
            k-=v2[i].second;
            v2[i].second=0;
            
        }
          
    
     
    }
    for(int i=0; i<v2.size(); i++){
        if(v2[i].second>0){
            res++;
        }
    }
    if(res==0){
        res=1;
    }


    cout<<res<<endl;
    }
}
Problem: 2061D - Kevin and Numbers
Language: C++20 (GCC 13-64)


Submission (verdict: Time limit exceeded on test 3):
#include <bits/stdc++.h>
using namespace std;
namespace A
{
    const long long N = 3e5 + 20, M = 998244353;
#define eps 1e-12
#define int long long
#define ll long long
#define all(x) x.begin(), x.end()
#define endl '\n'
#define ls (p << 1)
#define rs ((p << 1) | 1)
#define f1 first
#define pb push_back
#define f2 second
#define IOS ios::sync_with_stdio(0), cin.tie(0), cout.tie(0), cout << fixed << setprecision(2);
}
using namespace A;
//__int128
int read()
{
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9')
    {
        f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9')
    {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    x *= f;
    return x;
}
void write(int x)
{
    if (x < 0)
    {
        putchar('-');
        x = -x;
    }
    if (x > 9)
        write(x / 10);
    putchar(x % 10 + '0');
}
/*task1
{
每日错题
}*/
/*task2
{
div2 D
做到80%概率做E,10场<=20%概率降级
0 1
50%
提升一个阶段后尝试学习10个新算法
G  or 牛客博弈论专题 10题
}*/
int t, n, m;
signed main()
{
    IOS;
    cin >> t;
    while (t--)
    {
        cin >> n >> m;
        int x;
        priority_queue<pair<int, int>> q1, q2;
        for (int i = 1; i <= n; i++)
        {
            cin >> x;
            q1.push({x, 1});
        }
        for (int i = 1; i <= m; i++)
        {
            cin >> x;
            q2.push({x, 1});
        }
        int ok = 1;
        while (q1.size() && q2.size())
        {
            auto [p1, t1] = q1.top();
            auto [p2, t2] = q2.top();
            q1.pop(), q2.pop();
            if (p1 == p2)
            {
                if (t1 == t2)
                    continue;
                else if (t1 > t2)
                {
                    q1.push({p1, t1 - t2});
                }
                else
                    q2.push({p2, t2 - t1});
            }
            else if (p1 < p2)
            {
                if (p2 % 2 == 1)
                {
                    q2.push({p2 / 2, t2});
                    q2.push({p2 / 2 + 1, t2});
                    q1.push({p1, t1});
                }
                else
                {
                    int u = t2;
                    while (p2 / 2 >= p1 && p2 % 2 == 0)
                    {
                        p2 /= 2;
                        u *= 2;
                    }
                    q2.push({p2, u});
                    q1.push({p1, t1});
                }
            }
            else
            {
                ok = 0;
                break;
            }
        }
        if (q1.size() || q2.size())
            ok = 0;
        cout << (ok ? "YES\n" : "NO\n");
    }
    return false;
}
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 endl '\n'
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<long long int,long long int> pll;
typedef vector<int> vi;
typedef vector<long long int> vll;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<long long int,long long int>> vpll;
typedef map<long long int,long long int> mll;
typedef unordered_map<long long int,long long int> umll;
typedef set<int> si;
typedef set<char> sc;
#define F first
#define S second
#define sz(a) int((a).size())
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vpdsort(a) sort(a.rbegin(),a.rend())
#define vpasort(a) sort(a.begin(),a.end())
#define asort(a) sort(a.begin(),a.end())
#define dsort(a) sort(a.begin(),a.end(),greater<long long int>())
#define ai(i,s,n) for(int i=s ; i<n ;++i ){ cin>>arr[i]; }
#define pb push_back
#define mp make_pair
void debug() { cout<<"debug\n";}
void yes() { cout<<"YES\n"; }
void no() { cout<<"NO\n"; }
void swapint(int* a,int* b){ int t=*a; *a=*b; *b=t;}
void swapv(vll &v,ll i,ll j){ ll t=v[i];v[i]=v[j];v[j]=t;}
#define mod 1e9 + 7
#define PI 3.1415926535897932384626433832795
 
 
void solve()
{
    ll l,r;cin>>l>>r;
    int tbit = 0;
    for(int i=29;i>=0;--i){
        if(((r&(1LL<<i))!=0) && ((l&(1LL<<i))==0)){
            tbit = i;
            break;
        }
    }
    // cout<<tbit<<endl;
    ll a = r;
    ll b = r;
    ll c = r;
    for(int i=0;i<tbit;++i){
        a = a & (~(1LL<<i));
        b = b || (1LL<<i);
    }
    b = b & (~(1LL<<tbit));
    for(ll i=l;i<=r;++i){
        if(i!=a && i!=b){
            c = i;
            break;
        }
    }
    cout<<a<<" "<<b<<" "<<c<<endl;
}
 


/* main()  FUNCTION */
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int tc;cin >> tc;
    while(tc--) 

    solve();
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 1):
#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;
   int ans = 0;
   while(1){
    if(ksm(2 , cnt) <= r){
        ans = ksm(2 , cnt);
        cnt++;
    }
    else{
        break;
    }

   }
   cout<<ans<<' '<<ans-1<<' '<<l<<endl;

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

Submission (verdict: Wrong answer on test 1):
#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;
   int ans = 0;
//    while(1){
//     if(ksm(2 , cnt) <= r){
//         ans = ksm(2 , cnt);
//         cnt++;
//     }
//     else{
//         break;
//     }

//    }
//    if(ans -2 <= l){
//     cout<<ans<<' '<<ans-1<<' '<<l<<endl;
//    }
//     int a = (123  ^121) + (123 ^118) + (121 ^ 118);
//     int b = (115  ^ 117) + (120 ^117) + (115^120);
//     cout<<a<<' '<<b<<endl;

    if(r - l >= 5){
        cout<<l<<' '<<l+2<<' '<<l+2+3<<endl;
        return;
    }
    cout<<l<<' '<<l+1<<' '<<l+2<<endl;
}
 
 
signed main(){
    ios::sync_with_stdio(false);
    cout.tie(0);
    cin.tie(0);
    int _ = 1;
    cin>>_; 
    while(_--)solve();
    return 0;
}