ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)

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

void solve(int n) {
    vector<vector<int>> adj(n+1);
    vector<int> deg(n+1, 0);
    for (int i = 0; i < n-1; i++) {
        int a, b;
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
        deg[a]++; deg[b]++;
    }
    int mx1 = 0;
    for (int i = 1; i <= n; i++) if (deg[i] > deg[mx1]) mx1 = i;
    int ans = deg[mx1] - 1;
    deg[mx1] = 0;
    for (int u : adj[mx1]) deg[u]--;
    int mx2 = 0;
    for (int i = 1; i <= n; i++) if (deg[i] > deg[mx2]) mx2 = i;
    ans += deg[mx2];
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        cin >> n;
        solve(n);
    }

    return 0;
}

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

void solve(int n) {
    vector<vector<int>> adj(n+1);
    vector<int> deg(n+1, 0);
    for (int i = 0; i < n-1; i++) {
        int a, b;
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
        deg[a]++; deg[b]++;
    }

    int c1 = 0, c2 = 0;
    for (int i = 1; i <= n; i++) {
        if (deg[i] >= deg[c2]) {
            c2 = i;
            if (deg[c2] >= deg[c1]) swap(c1, c2);
        }
    }

    int ans1 = 0, ans2 = 0;
    for (int u : adj[c1]) deg[u]--;
    for (int i = 1; i <= n; i++) if (i != c1) ans1 = max(ans1, deg[i]);
    for (int u : adj[c1]) deg[u]++;
    ans1 += (deg[c1]-1);
    for (int u : adj[c2]) deg[u]--;
    for (int i = 1; i <= n; i++) if (i != c2) ans2 = max(ans2, deg[i]);
    ans2 += (deg[c2]-1);
    cout << max(ans1, ans2) << '\n';
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        cin >> n;
        solve(n);
    }

    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)


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

void solve(int n) {
    vector<vector<int>> adj(n+1);
    vector<int> deg(n+1, 0);
    for (int i = 0; i < n-1; i++) {
        int a, b;
        cin >> a >> b;
        adj[a].push_back(b);
        adj[b].push_back(a);
        deg[a]++; deg[b]++;
    }
    int mx1 = 0;
    for (int i = 1; i <= n; i++) if (deg[i] > deg[mx1]) mx1 = i;
    int ans = deg[mx1];
    deg[mx1] = 0;
    for (int u : adj[mx1]) deg[u]--;
    int mx2 = 0;
    for (int i = 1; i <= n; i++) if (deg[i] > deg[mx2]) mx2 = i;
    ans += deg[mx2] - 1;
    cout << ans << '\n';
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
 
    int tt;
    cin >> tt;
    while (tt--) {
        int n;
        cin >> n;
        solve(n);
    }

    return 0;
}
Problem: 2063C - Remove Exactly Two
Language: C++17 (GCC 7-32)


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

vector<vector<int>> G;
vector<int> degs;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m, q, t, a, b, u, v;
    cin >> t;
    while(t--){
        cin >> n;
        G.clear();
        G.resize(n + 2);
        degs.clear();
        degs.resize(n + 2);
        for(int i = 1 ; i < n ; i++){
            cin >> v >> u;
            G[u].push_back(v);
            G[v].push_back(u);
            degs[u]++;
            degs[v]++;
        }
        int ans = 1, maxDeg = -1, idx = 0;
        for(int i = 1 ; i <= n ; i++){
            //cerr << degs[i] << " ";
            if(degs[i] > maxDeg){
                maxDeg = degs[i];
                idx = i;
            }
        }
        ans += maxDeg - 1;
        for(int i : G[idx]){
            degs[i]--;
        }
        degs[idx] = -1;
        maxDeg = -1;
        for(int i = 1 ; i <= n ; i++){
            //cerr << degs[i] << " ";
            if(degs[i] > maxDeg){
                maxDeg = degs[i];
                idx = i;
            }
        }
        ans += maxDeg - 1;
        cout << ans << '\n';
    }
}
Problem: 2049C - MEX Cycle
Language: C++20 (GCC 13-64)


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

using namespace std;



typedef long long ll;

typedef long long ll;

typedef vector<ll> vi;

typedef vector<char> vc;

typedef vector<long long> vll;

typedef unsigned long long ull;

typedef vector<pair<ll, ll>> vpii;

typedef vector<pair<ll, char>> vpic;



#define for1(i, n1, n2) for(ll i = n1; i < n2; i++)  

#define for2(i, n2, n1) for(ll i = n2; i > n1; i--)  

#define vecMAX(v) *max_element(v.begin(), v.end())     

#define vecMIN(v) *min_element(v.begin(), v.end())      

#define srt(v) sort(v.begin(), v.end())               

#define rev(v) reverse(v.begin(), v.end())             

#define pb push_back                                  

#define inx ll p[0]; cin >> p[0];                           

#define vin(v) for(auto &it : v) cin >> it;               

#define mp make_pair                                  

#define ff first                                       

#define ss second                                       

#define v_erase(i) v.erase(v.begin() + i);          

#define sum(v) accumulate(v.begin(), v.end(), 0)        

#define INF 1e9                                         

#define MOD 1000000007                                 

#define sz(v) ((ll)(v).size())  

#define Code_by_Millenialkiid ios::sync_with_stdio(0); cin.tie(0);

#ifndef ONLINE_JUDGE



    #include "Jatt_don't_Care.h"

#else

    #define see(...) 42 

#endif

void solve() {

ll n,x,y;

cin>>n>>x>>y;

x--,y--;

vll ans(n,0);

for1(i,0,n){

    if(i%2==1){

        ans[i]=1;

    }

}

if(x%2==0){

    if(abs(y-x)%2==0){

        ans[x]=2;

        ans[y]=2;



    }

}else{

    if(abs(y-x)%2==0){

        ans[x]=2;

        ans[y]=2;

    }

}

for1(i,0,n){

    cout<<ans[i]<<" ";

}

cout<<"\n";

}

signed main() {

   Code_by_Millenialkiid

   ll t;

    cin >> t;                 



    for (ll i = 0; i < t; i++) {

        #ifndef ONLINE_JUDGE



            cout << "-----------------" << i + 1 << endl;

        #endif



       solve(); 

    }



    return 0;

}
Problem: 2052A - Adrenaline Rush
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 4):
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")

using namespace std;

int binary(vector<int>& a, int n) {
	int start = 0, end = a.size() - 1;
	while (start<=end) {
		int mid = (start + end) / 2;
		if (a[mid] == n) return mid;
		if (a[mid] > n) end = mid - 1;
		else start = mid + 1;
	}
	return -5;;
}

void solve() {
	int n, count = 0;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n), f, s;
	iota(b.begin(), b.end(), 1);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		//cout << b[i] << " ";
	}
	int end = n;
	for (int i = n - 1; i > 0; i--) {
		int c = binary(b, a[i]);
		//cout << c; return;
		if (c == b.size() - 1) {
			f.push_back(b[c]);
			f.push_back(b[c - 1]);
			s.push_back(b[c - 1]);
			s.push_back(b[c]);
			//cout << b[c] << " " << b[c - 1] << endl;
			//cout << b[c - 1] << " " << b[c] << endl;
			count += 2;
		}
		else {
			for (int j = c + 1; j < b.size(); j++) {
				f.push_back(b[j]);
				s.push_back(b[j - 1]);
				//cout << b[j] << " " << b[j - 1] << endl;
				swap(b[j], b[j - 1]);
				count++;
			}
		}
		b.erase(b.end()-1);
	}
	cout << count << endl;
	for (int i = 0; i < count; i++) {
		cout << f[i] << " " << s[i] << endl;
	}
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);

	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
		cout << endl;
	}

	return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 3):
/* In the Name of ALLAH */
/** Minhaz Uddin
   Dept of CSE,Comilla University*/

#include<bits/stdc++.h>
#define ll long long
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define tst int t;cin>>t;while(t--)
#define pb push_back
#define rvs reverse(v.begin(),v.end())
#define srt sort(v.begin(),v.end())

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll  N = 1e7+9;

void solve()
{
string s;
cin>>s;
ll n,i,j, sum = 0, c2 = 0, c3 = 0;
for(i = 0;i<s.size();i++)
{
    sum+=s[i]-'0';
    if(s[i]=='2')c2++;
    else if(s[i]=='3')c3++;
}
if(sum%9==0)yes
else
{
    ll mod =9- (sum%9);
    //cout<<mod<<endl;
    if(mod==8)
    {
        if(c3>=1 && c2>=1)yes
        else if(c3>=0 && c2>=4)yes
        else no
    }
    else if(mod==7)
    {
        if(c2>=2 && c3>=2)yes
        else if(c3>=1 && c2>=5)yes
        else no
    }
    else if(mod==6)
    {
       if(c3>=1)yes
       else if(c2>=3) yes
        else no
    }
    else if(mod==5)
    {
        if(c3>=2 && c2>=1)yes
        else if(c3>=1 && c2>=4)yes
        else no
    }
    else if(mod==4)
    {
        if(c2>=2 )yes
        else no
    }
    else if(mod==3)
    {
        if(c3>=1 && c2>=3)yes
        else if(c3>=2)yes
        else if(c2>=6)yes
        else no
    }
    else if(mod==2)
    {
        if(c2>=1)yes
        else no
    }
    else if(mod==1)
    {
        if(c2>=2 && c3>=1)yes
        else if(c2>=5)yes
        else no
    }

    else no
}
}



int main()
{
optimize();
tst{
solve();
}
return 0;
}

Submission (verdict: Accepted):
/* In the Name of ALLAH */
/** Minhaz Uddin
   Dept of CSE,Comilla University*/

#include<bits/stdc++.h>
#define ll long long
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define tst int t;cin>>t;while(t--)
#define pb push_back
#define rvs reverse(v.begin(),v.end())
#define srt sort(v.begin(),v.end())

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll  N = 1e7+9;

void solve()
{
string s;
cin>>s;
ll n,i,j, sum = 0, c2 = 0, c3 = 0;
for(i = 0;i<s.size();i++)
{
    sum+=s[i]-'0';
    if(s[i]=='2')c2++;
    else if(s[i]=='3')c3++;
}
if(sum%9==0)yes
else
{
    ll mod =9- (sum%9);
    if(mod%2==1)mod+=9;
    while(mod-6>=0 && c3>0)
    {
        mod-=6;
        c3--;
    }
    while(mod-2>=0 && c2>0)
    {
        mod-=2;
        c2--;
    }
    if(mod==0)yes
    else no
}
}



int main()
{
optimize();
tst{
solve();
}
return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 3):
/* In the Name of ALLAH */
/** Minhaz Uddin
   Dept of CSE,Comilla University*/

#include<bits/stdc++.h>
#define ll long long
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define tst int t;cin>>t;while(t--)
#define pb push_back
#define rvs reverse(v.begin(),v.end())
#define srt sort(v.begin(),v.end())

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
using namespace std;
const ll  N = 1e7+9;

void solve()
{
string s;
cin>>s;
ll n,i,j, sum = 0, c2 = 0, c3 = 0;
for(i = 0;i<s.size();i++)
{
    sum+=s[i]-'0';
    if(s[i]=='2')c2++;
    else if(s[i]=='3')c3++;
}
if(sum%9==0)yes
else
{
    ll mod =9- (sum%9);
    //cout<<mod<<endl;
    if(mod==8)
    {
        if(c3>=1 && c2>=1)yes
        else if(c3>=0 && c2>=4)yes
        else no
    }
    else if(mod==7)
    {
        if(c2>=2 && c3>=2)yes
        else if(c3>=1 && c2>=5)yes
        else no
    }
    else if(mod==6)
    {
       if(c3>=1)yes
       else if(c2>=3) yes
        else no
    }
    else if(mod==5)
    {
        if(c3>=2 && c2>=1)yes
        else if(c3>=1 && c2>=4)yes
        else no
    }
    else if(mod==4)
    {
        if(c2>=2 )yes
        else no
    }
    else if(mod==3)
    {
        if(c3>=2)yes
        else if(c2>=6)yes
        else no
    }
    else if(mod==2)
    {
        if(c2>=1)yes
        else no
    }
    else if(mod==1)
    {
        if(c2>=2 && c3>=1)yes
        else no
    }

    else no
}
}



int main()
{
optimize();
tst{
solve();
}
return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

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

int32_t main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int t=1;
  cin>>t;
  while(t--)
  {
  	int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,greater<int>());
    priority_queue<int>pq;
    for(int j=0;j<m;j++){
      int x;
      cin>>x;
      pq.push(x);
    }
    int i=0,c=0;
    bool ans=true;
    while(1){
      if(i==n)
        break;
      int x=pq.top();
      if(a[i]==x){
        pq.pop();
        i++;
        continue;
      }
      while(pq.top()>a[i]){
        x=pq.top();
        if(x==1)
          break;
        pq.pop();
        int y=x/2;
        int z=x/2+x%2;
        c++;
        if(c>n-m)
          break;
        pq.push(y);
        pq.push(z);
        if(pq.top()==a[i]){
          pq.pop();
          i++;
          break;
        }
      }
      if(pq.top()<a[i] || c>n-m){
          ans=false;
          break;
        }
    }
    if(ans && c==n-m)
      cout<<"YES"<<'\n';
    else cout<<"NO"<<'\n';
  }
  return 0;
}

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

int32_t main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int t=1;
  cin>>t;
  while(t--)
  {
  	int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,greater<int>());
    priority_queue<int>pq;
    for(int j=0;j<m;j++){
      int x;
      cin>>x;
      pq.push(x);
    }
    int i=0,c=0;
    bool ans=true;
    while(1){
      if(i==n)
        break;
      int x=pq.top();
      if(a[i]==x){
        pq.pop();
        i++;
        continue;
      }
      while(pq.top()>a[i]){
        x=pq.top();
        if(x==1)
          break;
        pq.pop();
        int y=x/2;
        int z=x/2+x%2;
        c++;
        if(c>n-m)
          break;
        pq.push(y);
        pq.push(z);
        if(pq.top()==a[i]){
          pq.pop();
          i++;
          break;
        }
      }
      if(pq.top()<a[i] || i>=n || c>n-m){
          ans=false;
          break;
        }
    }
    if(ans && c==n-m)
      cout<<"YES"<<'\n';
    else cout<<"NO"<<'\n';
  }
  return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)


Submission (verdict: Runtime error on test 2):
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int32_t main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int t=1;
  cin>>t;
  while(t--)
  {
  	int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,greater<int>());
    priority_queue<int>pq;
    for(int j=0;j<m;j++){
      int x;
      cin>>x;
      pq.push(x);
    }
    int i=0,c=0;
    bool ans=true;
    while(1){
      if(i==n)
        break;
      int x=pq.top();
      if(a[i]==x){
        pq.pop();
        i++;
        continue;
      }
      while(pq.top()>a[i]){
        x=pq.top();
        if(x==1)
          break;
        pq.pop();
        int y=x/2;
        int z=x/2+x%2;
        c++;
        if(c>n-m)
          break;
        pq.push(y);
        pq.push(z);
        if(pq.top()==a[i]){
          pq.pop();
          i++;
          break;
        }
      }
      if(pq.top()<a[i] || c>n-m){
          ans=false;
          break;
        }
    }
    if(ans && c==n-m)
      cout<<"YES"<<'\n';
    else cout<<"NO"<<'\n';
  }
  return 0;
}
Problem: 2061D - Kevin and Numbers
Language: C++17 (GCC 7-32)

Previous submission (verdict: Runtime error on test 2):
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int32_t main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int t=1;
  cin>>t;
  while(t--)
  {
  	int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,greater<int>());
    priority_queue<int>pq;
    for(int j=0;j<m;j++){
      int x;
      cin>>x;
      pq.push(x);
    }
    int i=0,c=0;
    bool ans=true;
    while(1){
      if(i==n)
        break;
      int x=pq.top();
      if(a[i]==x){
        pq.pop();
        i++;
        continue;
      }
      while(pq.top()>a[i]){
        x=pq.top();
        if(x==1)
          break;
        pq.pop();
        int y=x/2;
        int z=x/2+x%2;
        c++;
        if(c>n-m)
          break;
        pq.push(y);
        pq.push(z);
        if(pq.top()==a[i]){
          pq.pop();
          i++;
          break;
        }
      }
      if(pq.top()<a[i] || c>n-m){
          ans=false;
          break;
        }
    }
    if(ans && c==n-m)
      cout<<"YES"<<'\n';
    else cout<<"NO"<<'\n';
  }
  return 0;
}

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

int32_t main()
{
  ios_base::sync_with_stdio(0);cin.tie(0);
  int t=1;
  cin>>t;
  while(t--)
  {
  	int n,m;
    cin>>n>>m;
    int a[n];
    for(int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,greater<int>());
    priority_queue<int>pq;
    for(int j=0;j<m;j++){
      int x;
      cin>>x;
      pq.push(x);
    }
    int i=0,c=0;
    bool ans=true;
    while(1){
      if(i==n)
        break;
      int x=pq.top();
      if(a[i]==x){
        pq.pop();
        i++;
        continue;
      }
      while(pq.top()>a[i]){
        x=pq.top();
        if(x==1)
          break;
        pq.pop();
        int y=x/2;
        int z=x/2+x%2;
        c++;
        if(c>n-m)
          break;
        pq.push(y);
        pq.push(z);
        if(pq.top()==a[i]){
          pq.pop();
          i++;
          break;
        }
      }
      if(pq.top()<a[i] || c>n-m){
          ans=false;
          break;
        }
    }
    if(ans && c==n-m)
      cout<<"YES"<<'\n';
    else cout<<"NO"<<'\n';
  }
  return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: Java 21

Previous submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1; int c = a-2;
        if (b<l){
            b=a+1; c=b+1;
        }
        if (c<l) c=a+1;
        System.out.println(a+ " " + b+ " "+ c);
    }
} 

Submission (verdict: Accepted):
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            int a = pick(l,r);
            System.out.println(a);
            int b = a-1; System.out.println(b);
            int c = l; while (c==a || c==b) c++;
            System.out.println(c); 
        }
        sc.close();
    }

    public static int pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;

        if ((a&r) == (a&l)) return a+pick(l-a, r-a);
        return a;
    }
}
Problem: 2057C - Trip to the Olympiad
Language: Java 21

Previous submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1;
        int c = a-2;
        if (c<l) c=a+1;
        System.out.println(a+ " " + b+ " "+ c);
    }
} 

Submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1; int c = a-2;
        if (b<l){
            b=a+1; c=b+1;
        }
        if (c<l) c=a+1;
        System.out.println(a+ " " + b+ " "+ c);
    }
}
Problem: 2057C - Trip to the Olympiad
Language: Java 21

Previous submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1;
        int c = a-2;
        System.out.println(a+ " " + b+ " "+ c);
    }
} 

Submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1;
        int c = a-2;
        if (c<l) c=a+1;
        System.out.println(a+ " " + b+ " "+ c);
    }
}
Problem: 2057C - Trip to the Olympiad
Language: Java 21


Submission (verdict: Wrong answer on test 1):
import java.util.Scanner;
import java.util.Arrays;
 
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int tt = sc.nextInt();
        while(tt-->0){
            int l = sc.nextInt(); int r = sc.nextInt();
            pick(l,r);
        }
        sc.close();
    }

    public static void pick(int l, int r){
        int a = 1;
        while (a<<1 <= r) a=a<<1;
        int b = a-1;
        int c = a-2;
        System.out.println(a+ " " + b+ " "+ c);
    }
}