ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)

Previous submission (verdict: Wrong answer on test 1):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i, l, r) for(int i=l;i<r;i++)
#define for0(i, r, l) for(int i=r;i>l;i--)
#define all(a) a.begin(),a.end()


void solve(){
    int l,r;
    cin>>l>>r;
    vector a(3,0);
    int y = __lg(r);
    for0(i,y,-1){
        sort(all(a));
        int t = 1<<i;
        if(a[0]+t<=r){
            a[0]+=t;
        }
        if(a[1]+t-1 < l){
            a[1]+=t;
        }
        if(a[2]+t-1 < l){
            a[2]+=t;
        }
    }
    sort(all(a));
    if(a[1] == a[2]) a[1]++;
    cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<"\n";
    //cout<<(a[0] ^ a[1]) + (a[1] ^ a[2]) + (a[0] ^ a[2])<<"\n";
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        solve();
    }
    return 0;
}

Submission (verdict: Accepted):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i, l, r) for(int i=l;i<r;i++)
#define for0(i, r, l) for(int i=r;i>l;i--)
#define all(a) a.begin(),a.end()


void solve(){
    int l,r;
    cin>>l>>r;
    vector a(3,0);
    int y = __lg(r);
    for0(i,y,-1){
        sort(all(a));
        int t = 1<<i;
        if(a[0]+t<=r){
            a[0]+=t;
        }
        if(a[1]+t-1 < l){
            a[1]+=t;
        }
        if(a[2]+t-1 < l){
            a[2]+=t;
        }
    }
    sort(all(a));
    if(a[1] == a[0]) a[1]++;
    if(a[2] == a[1]) a[2]++;
    cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<"\n";
    //cout<<(a[0] ^ a[1]) + (a[1] ^ a[2]) + (a[0] ^ a[2])<<"\n";
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        solve();
    }
    return 0;
}
Problem: 2057C - Trip to the Olympiad
Language: C++20 (GCC 13-64)


Submission (verdict: Wrong answer on test 2):
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define forn(i, l, r) for(int i=l;i<r;i++)
#define for0(i, r, l) for(int i=r;i>l;i--)
#define all(a) a.begin(),a.end()


void solve(){
    int l,r;
    cin>>l>>r;
    int t1 = 0, t2 = 0;
    int t = __lg(r);
    for0(i,t,-1){
        if(t1 + (1<<i) <= r){
            t1 += (1<<i);
            if(t2 + (1<<i) - 1 < l){
                t2 += (1<<i);
            }
        }else if(t2 + (1<<i) <= r){
            t2 += (1<<i);
            if(t1 + (1<<i) - 1 < l){
                t1 += (1<<i);
            }
        }
    }
    for(int i=l;i<=r;i++){
        if(i != t1 && i != t2){
            cout<<t1<<" "<<t2<<" "<<i<<"\n";
            //cout<<(t1^t2) + (t1^i) + (t2^i)<<"\n";
            return;
        }
    }
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int tc = 1;
    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        solve();
    }
    return 0;
}
Problem: 2049B - pspspsps
Language: C++20 (GCC 13-64)

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

using namespace std;

using ll=long long;

int main()

{

    ll cases;

    cin>>cases;

    while(cases--)

    {

        ll n;

        cin>>n;

        vector<ll>arr(n,0);

        bool flag1=0;

        bool flag2=0;

        string s;

        cin>>s;

        for(ll i=1;i<s.size()-1;i++)

        {

            if(s[i]=='s')

            flag1=1;

            if(s[i]=='p')

            flag2=1;

        }

        if(flag1)

        {

            if(flag2)

            {

                cout<<"YES"<<endl;

            }

            else

            {

                cout<<"NO"<<endl;

            }

        }

        else

        {

            cout<<"NO"<<endl;

        }

    }

}

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

using namespace std;

using ll=long long;

int main()

{

    ll cases;

    cin>>cases;

    while(cases--)

    {

        ll n;

        cin>>n;

        vector<ll>arr(n,0);

        bool flag1=0;

        bool flag2=0;

        string s;

        cin>>s;

        for(ll i=1;i<s.size()-1;i++)

        {

            if(s[i]=='s')

            flag1=1;

            if(s[i]=='p')

            flag2=1;

        }

        if(flag1)

        {

            if(flag2)

            {

                cout<<"NO"<<endl;

            }

            else

            {

                cout<<"YES"<<endl;

            }

        }

        else

        {

            cout<<"YES"<<endl;

        }

    }

}
Problem: 2049B - pspspsps
Language: C++20 (GCC 13-64)

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

using namespace std;

using ll=long long;

int main()

{

    ll cases;

    cin>>cases;

    while(cases--)

    {

        ll n;

        cin>>n;

        vector<ll>arr(n,0);

        bool flag1=0;

        bool flag2=0;

        string s;

        cin>>s;

        for(ll i=1;i<s.size()-1;i++)

        {

            if(s[i]=='s')

            flag1=1;

            if(s[i]=='p')

            flag2=1;

        }

        if(flag1)

        {

            if(flag2)

            {

                cout<<"NO"<<endl;

            }

            else

            {

                cout<<"YES"<<endl;

            }

        }

        else

        {

            cout<<"YES"<<endl;

        }

    }

}

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

using namespace std;

using ll=long long;

int main()

{

    ll cases;

    cin>>cases;

    while(cases--)

    {

        ll n;

        cin>>n;

        vector<ll>arr(n,0);

        bool flag1=0;

        bool flag2=0;

        string s;

        cin>>s;

        if(s[0]=='s')

        s[0]='.';

        if(s[s.size()-1]=='p')

        s[n-1]='.';

        for(ll i=0;i<s.size();i++)

        {

            if(s[i]=='s')

            flag1=1;

            if(s[i]=='p')

            flag2=1;

        }

        if(flag1)

        {

            if(flag2)

            {

                cout<<"NO"<<endl;

            }

            else

            {

                cout<<"YES"<<endl;

            }

        }

        else

        {

            cout<<"YES"<<endl;

        }

    }

}
Problem: 2049B - pspspsps
Language: C++20 (GCC 13-64)


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

using namespace std;

using ll=long long;

int main()

{

    ll cases;

    cin>>cases;

    while(cases--)

    {

        ll n;

        cin>>n;

        vector<ll>arr(n,0);

        bool flag1=0;

        bool flag2=0;

        string s;

        cin>>s;

        for(ll i=1;i<s.size()-1;i++)

        {

            if(s[i]=='s')

            flag1=1;

            if(s[i]=='p')

            flag2=1;

        }

        if(flag1)

        {

            if(flag2)

            {

                cout<<"YES"<<endl;

            }

            else

            {

                cout<<"NO"<<endl;

            }

        }

        else

        {

            cout<<"NO"<<endl;

        }

    }

}
Problem: 2063B - Subsequence Update
Language: C++20 (GCC 13-64)


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



#ifdef TEPAMID

#define debug(x) cerr << #x << " = " << x << endl;

#define debug_v(v)            \

    {                         \

        cerr << #v << " = ";  \

        for (auto x : v)      \

            cerr << x << " "; \

        cerr << endl;         \

    }

#define debug_vp(v)                       \

    {                                     \

        cerr << #v << " = ";              \

        for (auto [x, y] : v)             \

            cerr << x << "," << y << " "; \

        cerr << endl;                     \

    }

#else

#define debug(x) 0;

#define debug_v(x) 0;

#define debug_vp(x) 0;

#endif // HOME



using namespace std;



// mt19937 rng(5);

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



#define fo(i, n) for (int i = 0; i < n; ++i)

#define foback(i, n) for (int i = n - 1; i >= 0; --i)

#define fo1(i, n) for (int i = 1; i <= n; ++i)



#define all(x) x.begin(), x.end()

#define rall(x) x.rbegin(), x.rend()

#define makeunique(x) sort(all(x)), (x).resize(unique(all(x)) - (x).begin())



typedef long long ll;



void fastio()

{

    ios::sync_with_stdio(false);

    cin.tie(0);

    cout.tie(0);

}



void one();





int main() {

    fastio();



    int t = 1;

// #ifdef TEPAMID

    cin >> t;

// #endif



    fo(TEST, t)

    {

        debug(TEST)

        one();

    }



    return 0;

}





void one () {

    int n;   cin >> n;

    int l,r; cin >> l >> r; l--;

    

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

        cin >> a[i];

    }



    sort(all(a));



   ll ans=0;

for(int i=0; i<r-l; i++) ans += a[i];

cout << ans <<endl;



}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<long long> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i <= n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}


Submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<long long> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i < n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<int> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i <= n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}


Submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<long long> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i <= n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)

Previous submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<long long> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i < n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}


Submission (verdict: Accepted):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<long long> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0LL);
    while(n-->1){
      for(int i = 0; i < n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0LL));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}
Problem: 2062C - Cirno and Operations
Language: C++17 (GCC 7-32)


Submission (verdict: Wrong answer on test 2):
// https://codeforces.com/problemset/problem/2062/C

#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>

int main() {
  constexpr auto MAX_SIZE = 50;
  int t;
  std::cin >> t;
  std::vector<int> lst(MAX_SIZE);
  
  while (t-- > 0) {
    int n;
    std::cin >> n;
    for (int i = 0; i < n; ++i) {
      std::cin >> lst[i];
    }
    auto beg = lst.begin();
    auto max_sum = std::accumulate(beg, beg + n, 0);
    while(n-->1){
      for(int i = 0; i <= n; ++i){
        lst[i] -= lst[i+1];
      }
      auto sum = std::abs(std::accumulate(beg, beg + n, 0));
      if (sum > max_sum) max_sum = sum;
    }
    std::cout << max_sum << "\n";
  }
  return 0;
}
Problem: 2050E - Three Strings
Language: C++23 (GCC 14-64, msys2)


Submission (verdict: Wrong answer on test 2):
/// Bismillah
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

#define int long long
#define double long double
#define pii pair<int , int>
#define endl '\n'
typedef tree<int , null_type , less<int> , rb_tree_tag , tree_order_statistics_node_update> indexed_set;
typedef tree<int , null_type , less_equal<int> , rb_tree_tag , tree_order_statistics_node_update> indexed_multiset;
#define _FastIO ios_base::sync_with_stdio(0); cin.tie(0)
#define vi vector<int>
#define vpii vector<pii>
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define sz(x) (int)((x).size())
#define all(x) (x).begin() , (x).end()
#define rall(x) (x).rbegin() , (x).rend()
#define F first
#define S second
const int mod = 1e9 + 7;
const int N = 3e3 + 5;
const int INF = (int)2e18 + 123;

int dp[N][N];

void solve()
{
    string a , b , c;
    cin >> a >> b >> c;
    int n = sz(a) , m = sz(b);

    for(int i = 0; i < n + m; i++){
        for(int j = 0; j <= min(i + 1 , n); j++){ /// j chars of a
            dp[i + 1][j] = INT_MAX;
            if(i - j < m)
                dp[i + 1][j] = dp[i][j] + (b[i - j] != c[i]);
            if(j)
                dp[i + 1][j] = min(dp[i + 1][j] , dp[i][j - 1] + (a[j - 1] != c[i]));
            //cout << dp[i + 1][j] << " ";
        }
        //cout << '\n';
    }
    cout << dp[n + m][n] << '\n';
}


signed main(){
    _FastIO;
    int T = 1;
    cin >> T;
    while(T--){
        solve();
    }
    //system("pause");
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)


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

bool solve(string n) {
    int sum = 0;
    int left = 0, right = n.size() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        int digit_sum = 0;
		for (char c : n) {
		    digit_sum += c - '0'; 
		}
		
		if (digit_sum % 9 == 0) {
		    cout << "YES" << endl;
		} else {
		    cout << "NO" << endl;
		} else {
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

Previous submission (verdict: Compilation error):
#include <bits/stdc++.h>
using namespace std;

bool solve(string n) {
    int sum = 0;
    int left = 0, right = n.size() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        int digit_sum = 0;
		for (char c : n) {
		    digit_sum += c - '0'; 
		}
		
		if (digit_sum % 9 == 0) {
		    cout << "YES" << endl;
		} else {
		    cout << "NO" << endl;
		} else {
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}

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

bool solve(string n) {
    int sum = 0;
    int left = 0, right = n.length() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        int digit_sum = 0;
		for (char c : n) {
		    digit_sum += c - '0'; 
		}
		
		if (digit_sum % 9 == 0) {
		    cout << "YES" << endl;
		} else {
		    cout << "NO" << endl;
		} else {
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}
Problem: 2050C - Uninteresting Number
Language: C++23 (GCC 14-64, msys2)

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

bool solve(string n) {
    int sum = 0;
    size_t left = 0, right = n.size() - 1;

    // Two pointers, moving from both ends
    while (left <= right) {
        // Check the left pointer
        if (n[left] == '2') {
            sum += 4;  // 2^2 = 4
        } else if (n[left] == '3') {
            sum += 9;  // 3^2 = 9
        }
        
        // Check the right pointer (make sure it's not the same as the left)
        if (left != right) {
            if (n[right] == '2') {
                sum += 4;  // 2^2 = 4
            } else if (n[right] == '3') {
                sum += 9;  // 3^2 = 9
            }
        }

        // Move the pointers
        left++;
        right--;
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        
        int digit_sum = 0;
        for (char c : n) {
            digit_sum += c - '0';  // Sum of digits
        }

        // Check if the sum of digits is divisible by 9
        if (digit_sum % 9 == 0) {
            cout << "YES" << endl;
        } else {
            // If not, try the 'solve' method
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}


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

bool solve(string n) {
    int sum = 0;
    // Iterate through the digits, squaring the relevant digits
    for (char c : n) {
        int digit = c - '0';
        if (digit == 2) {
            sum += 4;  // 2^2 = 4
        } else if (digit == 3) {
            sum += 9;  // 3^2 = 9
        } else {
            sum += digit;  // Other digits remain unchanged
        }
    }

    // Check if the sum of squared digits is divisible by 9
    return (sum % 9 == 0);
}

int main() {
    int t;
    cin >> t;
    while(t--) {
        string n;
        cin >> n;
        
        // Step 1: Sum the digits first
        int digit_sum = 0;
        for (char c : n) {
            digit_sum += c - '0';  // Sum of digits
        }

        // Step 2: Check if the sum of digits is divisible by 9
        if (digit_sum % 9 == 0) {
            cout << "YES" << endl;
        } else {
            // Step 3: Call solve() to check if we can make it divisible by 9
            if (solve(n)) {
                cout << "YES" << endl;
            } else {
                cout << "NO" << endl;
            }
        }
    }
    return 0;
}