ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050E - Three Strings
Language: PyPy 3-64

Previous submission (verdict: Wrong answer on test 1):
def minimal_changes(a, b, c):
    m = len(a)
    n = len(b)
    c_len = len(c)
    if c_len != m + n:
        return -1  # Invalid case as per problem constraints

    # Initialize DP array
    dp = [0] * (n + 1)
    for j in range(1, n + 1):
        dp[j] = dp[j - 1] + (b[j - 1] != c[j - 1])

    for i in range(1, m + 1):
        prev = dp[0]
        dp[0] += (a[i - 1] != c[i - 1])
        for j in range(1, n + 1):
            temp = dp[j]
            dp[j] = min(prev + (b[j - 1] != c[i + j - 1]),
                         dp[j - 1] + (a[i - 1] != c[i + j - 1]))
            prev = temp

    return dp[n]

def main():
    import sys
    input = sys.stdin.read
    data = input().split()
    
    idx = 0
    t = int(data[idx])
    idx += 1
    results = []
    
    for _ in range(t):
        a = data[idx]
        idx += 1
        b = data[idx]
        idx += 1
        c = data[idx]
        idx += 1
        result = minimal_changes(a, b, c)
        results.append(result)
    
    for res in results:
        print(res)

if __name__ == "__main__":
    main()

Submission (verdict: Runtime error on test 1):
def main():
    import sys
    input = sys.stdin.read
    data = input().splitlines()
    t = int(data[0])
    idx = 1
    for _ in range(t):
        a = data[idx]
        b = data[idx + 1]
        c = data[idx + 2]
        idx += 3
        len_a = len(a)
        len_b = len(b)
        len_c = len_c
        INF = float('inf')
        dp = [[INF] * (len_b + 1) for _ in range(len_a + 1)]
        dp[0][0] = 0
        for sum_ in range(len_a + len_b):
            for j in range(max(0, sum_ - len_a), min(sum_ + 1, len_b + 1)):
                i = sum_ - j
                if i > len_a or j > len_b:
                    continue
                if i < len_a and j < len_b:
                    if a[i] != c[i + j]:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + 1)
                    else:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
                    if b[j] != c[i + j]:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1)
                    else:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j])
                if i == len_a and j < len_b:
                    if b[j] != c[i + j]:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1)
                    else:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j])
                if j == len_b and i < len_a:
                    if a[i] != c[i + j]:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + 1)
                    else:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
        print(dp[len_a][len_b])

if __name__ == "__main__":
    main()
Problem: 2050E - Three Strings
Language: PyPy 3-64

Previous submission (verdict: Runtime error on test 1):
def main():
    import sys
    input = sys.stdin.read
    data = input().splitlines()
    t = int(data[0])
    idx = 1
    for _ in range(t):
        a = data[idx]
        b = data[idx + 1]
        c = data[idx + 2]
        idx += 3
        len_a = len(a)
        len_b = len(b)
        len_c = len_c
        INF = float('inf')
        dp = [[INF] * (len_b + 1) for _ in range(len_a + 1)]
        dp[0][0] = 0
        for sum_ in range(len_a + len_b):
            for j in range(max(0, sum_ - len_a), min(sum_ + 1, len_b + 1)):
                i = sum_ - j
                if i > len_a or j > len_b:
                    continue
                if i < len_a and j < len_b:
                    if a[i] != c[i + j]:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + 1)
                    else:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
                    if b[j] != c[i + j]:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1)
                    else:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j])
                if i == len_a and j < len_b:
                    if b[j] != c[i + j]:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + 1)
                    else:
                        dp[i][j + 1] = min(dp[i][j + 1], dp[i][j])
                if j == len_b and i < len_a:
                    if a[i] != c[i + j]:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + 1)
                    else:
                        dp[i + 1][j] = min(dp[i + 1][j], dp[i][j])
        print(dp[len_a][len_b])

if __name__ == "__main__":
    main()

Submission (verdict: Accepted):
def main():
    import sys
    input = sys.stdin.read
    data = input().splitlines()
    t = int(data[0])
    idx = 1
    for _ in range(t):
        a = data[idx]
        b = data[idx + 1]
        c = data[idx + 2]
        idx += 3
        len_a = len(a)
        len_b = len(b)
        len_c = len(c)
        INF = float('inf')
        dp = [[INF] * (len_b + 1) for _ in range(len_a + 1)]
        dp[0][0] = 0
        for sum_ in range(len_a + len_b):
            for j in range(max(0, sum_ - len_a), min(sum_, len_b) + 1):
                i = sum_ - j
                if i > len_a or j > len_b:
                    continue
                if i < len_a and j < len_b:
                    cost_a = 0 if a[i] == c[i + j] else 1
                    dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + cost_a)
                    cost_b = 0 if b[j] == c[i + j] else 1
                    dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + cost_b)
                if i == len_a and j < len_b:
                    cost_b = 0 if b[j] == c[i + j] else 1
                    dp[i][j + 1] = min(dp[i][j + 1], dp[i][j] + cost_b)
                if j == len_b and i < len_a:
                    cost_a = 0 if a[i] == c[i + j] else 1
                    dp[i + 1][j] = min(dp[i + 1][j], dp[i][j] + cost_a)
        print(dp[len_a][len_b])

if __name__ == "__main__":
    main()
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 8):
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N],b[N];
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n, l, r;
		cin >> n >> l >> r;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
			b[i] = a[i];
		}
		sort(a+1, a + r+1);
		sort(b + l, b + n+1);
		int sum = 0;
		int sum1 = 0;
		for (int i = 1; i <= r - l+1; i++)
		{
			sum += a[i];
		}
		for (int i = l; i <= r; i++)
		{
			sum1 += b[i];
		}
		cout << min(sum, sum1) << endl;
		
	}
}

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

#include<algorithm>

using namespace std;

const int N = 1e5 + 10;

int a[N],b[N];

int main()

{

	int t;

	cin >> t;

	while (t--)

	{

		int n, l, r;

		cin >> n >> l >> r;

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

		{

			cin >> a[i];

			b[i] = a[i];

		}

		sort(a+1, a + r+1);

		sort(b + l, b + n+1);

		long long sum = 0;

		long long sum1 = 0;

		for (int i = 1; i <= r - l+1; i++)

		{

			sum += a[i];

		}

		for (int i = l; i <= r; i++)

		{

			sum1 += b[i];

		}

		cout << min(sum, sum1) << endl;

		

	}

}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n, l, r;
		cin >> n >> l >> r;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
		}
		sort(a, a + n);
		int sum = 0;
		for (int i = 0; i <= r - l; i++)
		{
			sum += a[i];
		}
		cout << sum << endl;
	}
}

Submission (verdict: Wrong answer on test 8):
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N],b[N];
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n, l, r;
		cin >> n >> l >> r;
		for (int i = 1; i <= n; i++)
		{
			cin >> a[i];
			b[i] = a[i];
		}
		sort(a+1, a + r+1);
		sort(b + l, b + n+1);
		int sum = 0;
		int sum1 = 0;
		for (int i = 1; i <= r - l+1; i++)
		{
			sum += a[i];
		}
		for (int i = l; i <= r; i++)
		{
			sum1 += b[i];
		}
		cout << min(sum, sum1) << endl;
		
	}
}
Problem: 2063B - Subsequence Update
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<iostream>
#include<algorithm>
using namespace std;
const int N = 1e5 + 10;
int a[N];
int main()
{
	int t;
	cin >> t;
	while (t--)
	{
		int n, l, r;
		cin >> n >> l >> r;
		for (int i = 0; i < n; i++)
		{
			cin >> a[i];
		}
		sort(a, a + n);
		int sum = 0;
		for (int i = 0; i <= r - l; i++)
		{
			sum += a[i];
		}
		cout << sum << endl;
	}
}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 == 0 && (x - y) % 2 == 0) {

            ans[x - 1] = 2;

        }

        else if (n % 2) {

            ans[0] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 

        --x, --y; 



        vector<int> ans(n); 

        

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

            ans[(x + i) % n] = i % 2;

        }

        if (n % 2 || (x - y) % 2 == 0) {

            ans[x] = 2;

        }

    

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)


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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 || (x - y)) {

            ans[x - 1] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 == 0 && (x - y)) {

            ans[x - 1] = 2;

        }

        else if (n % 2) {

            ans[0] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 == 0 && (x - y) % 2 == 0) {

            ans[x - 1] = 2;

        }

        else if (n % 2) {

            ans[0] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}
Problem: 2049C - MEX Cycle
Language: C++17 (GCC 7-32)

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 || (x - y)) {

            ans[x - 1] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

}

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

#include <vector>

#include <string>

#include <sstream>

#include <fstream>

#include <cstring>

#include <algorithm>

#include <cmath>

#include <map>

#include <bitset>

#include <numeric>

#include <set>

#include <queue>

#include <unordered_map>

#include <cassert>

#include <array>

#include <deque>

#include <functional>





using namespace std;

#define NDEBUG

#define endl "\n"

#define ff first

#define ss second

#define vi vector<int>

#define pii pair<int, int>

#define sz(x) (int)x.size()

//#define int long long

constexpr int MAX_N = 100'005;

constexpr int INF = 1E9;  





int32_t main() {

    // ifstream cin("MEXcycle.txt");

    ios_base::sync_with_stdio(false);

    cin.tie(NULL);

    int t; cin>>t; 



    while(t--) {

        int n, x, y; 

        cin>>n>>x>>y; 



        vector<int> ans; 

        

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

            if (i % 2) ans.push_back(0);

            else ans.push_back(1);

        }

        if (n % 2 == 0 && (x - y)) {

            ans[x - 1] = 2;

        }

        else if (n % 2) {

            ans[0] = 2;

        }

        for (auto& i : ans) cout<<i<<" ";

        cout<<endl; 

    }

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

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
#define int long long
map<int,int>a;
void solv(){
	int n;cin >> n;
	int mx = -24234353;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
	}
	if(mx != a[1]) cout << "YES"<<endl;
	else cout << "NO"<<endl;
	
	
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}




Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
#define int long long
map<int,int>a;
void solv(){
	int n;cin >> n;
	int mx = -24234353;
	int mn = 25325352;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
		mn = min(mn,a[i]);
	}
	if(mx != a[1]){
		cout << "YES"<<endl;
	} 
	else{
		if(a[n] == mx) cout << "YES"<<endl;
		else cout << "NO"<<endl;
	}
	
	
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Compilation error):
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+4;
#define int long long
int a[N];
int vis[N];
void solv(){
	int n;cin >> n;
	int mx = -24324334243;
	int mn = 24324334243;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
		mn = min(mn,a[i]);
	}
	for(int i = 1;i < n ;i++){
		if(a[i] == a[i+1]){
			i++;
		}
		else if(a[i] > a[i+1]){
			flag = 1;
			break;
		}
		else{
			a[i+1] -= a[i];
		}
	}
	if(flag) cout << "NO"<<endl;
	else cout << "YES"<<endl;
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}




Submission (verdict: Accepted):
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+4;
#define int long long
int a[N];
int vis[N];
void solv(){
	int flag = 0;
	int n;cin >> n;
	for(int i = 1;i <= n ;i++)	cin >> a[i];
	for(int i = 1;i < n ;i++){
		if(a[i] == a[i+1]){
			i++;
		}
		else if(a[i] > a[i+1]){
			flag = 1;
			break;
		}
		else{
			a[i+1] -= a[i];
		}
	}
	if(flag) cout << "NO"<<endl;
	else cout << "YES"<<endl;
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
#define int long long
map<int,int>a;
void solv(){
	int n;cin >> n;
	int mx = -24234353;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
	}
	if(mx != a[1]) cout << "YES"<<endl;
	else cout << "NO"<<endl;
	
	
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}
Problem: 2060D - Subtract Min Sort
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
#include<bits/stdc++.h>
using namespace std;
#define int long long
map<int,int>a;
void solv(){
	int n;cin >> n;
	int mx = -24234353;
	int mn = 25325352;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
		mn = min(mn,a[i]);
	}
	if(mx != a[1]){
		cout << "YES"<<endl;
	} 
	else{
		if(a[n] == mx) cout << "YES"<<endl;
		else cout << "NO"<<endl;
	}
	
	
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}




Submission (verdict: Compilation error):
#include<bits/stdc++.h>
using namespace std;
const int N = 2e5+4;
#define int long long
int a[N];
int vis[N];
void solv(){
	int n;cin >> n;
	int mx = -24324334243;
	int mn = 24324334243;
	for(int i = 1;i <= n ;i++){
		cin >> a[i];
		mx = max(mx,a[i]);
		mn = min(mn,a[i]);
	}
	for(int i = 1;i < n ;i++){
		if(a[i] == a[i+1]){
			i++;
		}
		else if(a[i] > a[i+1]){
			flag = 1;
			break;
		}
		else{
			a[i+1] -= a[i];
		}
	}
	if(flag) cout << "NO"<<endl;
	else cout << "YES"<<endl;
}
signed main(){
	int t;cin >> t;
	while(t--){
		solv();
	}
	return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef tree<long long, null_type, less<long long>, rb_tree_tag, tree_order_statistics_node_update> pbds; // find_by_order, order_of_key
 
#define ll long long
#define int long long
#define ld long double
#define inf 1000000000000000005
#define mod 1000000007
typedef pair<int, int> pii;
typedef vector<int> vii;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
#define pb push_back
#define ppb pop_back
#define puf push_front
#define pof pop_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sz(x) (ll)x.size()
#define HAR_HAR_MAHADEV ios_base::sync_with_stdio(false);cin.tie(NULL);
const int N = 1e6 + 10;
 
// std::cout << std::fixed;
// std::cout << std::setprecision(12);
// floor(2.3)
// ceil(2.3)

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
 
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
}; // unordered_map<ll , ll , custom_hash> mp;
 
//******//
//**Template_end***//

ll expo(ll a, ll b, ll mod1) {ll res = 1; while (b > 0) {if (b & 1ll)res = (res * a) % mod1; a = (a * a) % mod1; b = b >> 1ll;} return res;}

void solve(){
    int l , r; cin >> l >> r;
    int prev = 0;
    
    cout << r << " " << r - (int)1 << " " << l << "\n";
}  
 
int32_t main(){
 
    HAR_HAR_MAHADEV
 
    ll t = 1;
    cin >> t;
 
    while(t--){
        solve();
    } 

    // cout << "HELLO" << "\n";
 /*
   Think of the edge case (n == 1 ?).
   Don't get stuck on a single approach for a long time.
   Also don't get stuck on a single problem for a long time :).
 */   
 
    return 0;
}

/*

*/