ShaysXIA/CodeInsightBench huggingface dataset:
Problem: 2050C - Uninteresting Number
Language: c++20 

Code 1:
#include <bits/stdc++.h>
using namespace std;

// Function to check if a number represented by a string is divisible by 9
bool isDivisibleBy9(const string &s)
{
    int sum = 0;
    for (char c : s)
    {
        sum += (c - '0');
    }
    return (sum % 9 == 0);
}

// Function to determine if a number can become divisible by 9
string uninteresting_numbers(const string &s)
{
    int n = s.length();
    // DP table: dp[i][sum] indicates if it's possible to achieve the `sum`
    // using digits up to index `i`.
    vector<vector<bool>> dp(n + 1, vector<bool>(9, false));

    // Base case: sum 0 is achievable with no digits used.
    dp[0][0] = true;

    // Iterate over each digit of the number
    for (int i = 0; i < n; i++)
    {
        int digit = s[i] - '0';
        for (int sum = 0; sum < 9; sum++)
        {
            // If `sum` is achievable using the first `i` digits
            if (dp[i][sum])
            {
                // Case 1: Do not modify this digit
                dp[i + 1][(sum + digit) % 9] = true;

                // Case 2: Replace the digit with its square (if <= 3)
                if (digit <= 3)
                {
                    int squared = digit * digit;
                    dp[i + 1][(sum + squared) % 9] = true;
                }
            }
        }
    }

    // Check if any sum divisible by 9 is achievable using all digits
    for (int sum = 0; sum < 9; sum++)
    {
        if (dp[n][sum] && sum == 0)
        {
            return "YES";
        }
    }
    return "NO";
}

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


Code 2:
// https://codeforces.com/problemset/problem/2050/C
// uninteresting numbers
#include <bits/stdc++.h>
using namespace std;
bool test(string s)
{
    int sum = 0;
    for (int i = 0; i < s.length(); i++)
    {
        sum += s[i] - '0';
    }
    if (sum % 9 == 0)
        return true;
    return false;
}
void solution(string s, bool &counter, vector<bool> &visited)
{
    if (counter)
        return;
    counter = test(s);
    for (int i = 0; i < s.length(); i++)
    {
        if (!visited[i])
        {
            int no = s[i] - '0';
            visited[i] = true;
            if (no <= 3)
            {
                string copy = s;
                copy[i] = '0' + no * no;
                solution(copy, counter, visited);
            }
        }
    }
}
string uninteresting_numbers(string n)
{
    bool counter = false;
    vector<bool> visited(n.length(), false);
    solution(n, counter, visited);
    if (counter)
    {
        return "YES";
    }
    return "NO";
}
int main()
{
    int t;
    cin >> t;
    while (t--)
    {
        string number;
        cin >> number;
        cout << uninteresting_numbers(number) << endl;
    }
    return 0;
}


Answer: 1
Problem: 2050C - Uninteresting Number
Language: c++17 

Code 1:
#include<bits/stdc++.h>

using namespace std;

#define int long long

 

signed main() {

    int t;

    cin>>t;

    while(t--){

        string s;

        cin>>s;

        int n = s.size();

        int sum = 0;

        int two,three;

        two = three = 0;

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

            sum+=s[i]-'0';

            if(s[i]-'0' == 2) two++;

            if(s[i]-'0' == 3) three++;

        }

        int flag=0;

        int a =10;

        two = min(a,two);

        three = min(a,three);

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

            for(int j=0;j<=three;j++){

                if((sum+i*2+j*6)%9==0){

                    flag++;

                    break;

                }

            }

        }

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

        else{

            cout<<"NO\n";

        }      

        }

        

    

    return 0;

}

Code 2:
#include<bits/stdc++.h>

using namespace std;

#define int long long

 

signed main() {

    int t;

    cin>>t;

    while(t--){

        string s;

        cin>>s;

        int n = s.size();

        int sum = 0;

        int two,three;

        two = three = 0;

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

            sum+=s[i]-'0';

            if(s[i]-'0' == 2) two++;

            if(s[i]-'0' == 3) three++;

        }

        if(sum%9==0) cout<<"YES\n";

        else{

            int d = 9 - sum%9;

            if(d%2!=0) d+=9;

            // cout<<d<<" "<<two*2 + three*6<<endl;

            if(two*2 + three*6 >=d  ){

                d = d - two*2;

                if(d>=0 &&d%6!=0 )

                cout<<"NO\n";

                else if(d>=0 && d%6==0 && d/6 < three){

                    cout<<"NO\n";

                }

                else

                cout<<"YES\n";

            }

            else{

                cout<<"NO\n";

            }

            

        }

        

    }

    return 0;

}

Answer: 1
Problem: 2050C - Uninteresting Number
Language: c++17 

Code 1:
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        ll n;
        cin >> n;

        vector<int> digits;
        int sum = 0;

        while (n > 0) {
            int temp = n % 10;
            digits.push_back(temp);
            sum += temp;
            n /= 10;
        }

        if (sum % 9 == 0) {
            cout << "YES" << endl;
            continue;
        }

        int count2 = 0, count3 = 0;
        for (int digit : digits) {
            if (digit == 2) count2++;
            if (digit == 3) count3++;
        }
        bool possible = false;
        for (int i = 0; i <= count2 && !possible; i++) { 
            for (int j = 0; j <= count3 && !possible; j++) { 
                int newSum = sum + i * 2 + j * 6;
                if (newSum % 9 == 0) {
                    possible = true;
                    break;
                }
            }
            if(possible){break;}
        }

        if (possible) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


Code 2:
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main() {
    int t;
    cin >> t;
    while (t--) {
        string n;
        cin >> n;
        vector<int> digits;
        int sum = 0;
        for (char c : n) {
            int digit = c - '0';  
            digits.push_back(digit);
            sum += digit;  
        }
        if (sum % 9 == 0) {
            cout << "YES" << endl;
            continue;
        }
        int count2 = 0, count3 = 0;
        for (int digit : digits) {
            if (digit == 2) count2++;
            if (digit == 3) count3++;
        }
        bool possible = false;
        for (int i = 0; i <= count2 && !possible; i++) { 
            for (int j = 0; j <= count3 && !possible; j++) { 
                int newSum = sum + i * 2 + j * 6;
                if (newSum % 9 == 0) {
                    possible = true;
                    break;
                }
            }
        }
        if (possible) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }
    }
    return 0;
}


Answer: 2
Problem: 2050C - Uninteresting Number
Language: c++23 

Code 1:
#include <bits/stdc++.h>

using namespace std;



#define ll long long

#define pb push_back

#define F first

#define S second

#define pii pair<int,int>

#define vi vector<int>

#define vpii vector<pii>



#define loop(i,n) sloop(0,i,n)

#define sloop(s, i, n) for(ll i=(s);i<(n);i++)

#define rloop(i,n) rsloop(0,i,n)

#define rsloop(s,i,n) for(ll i=(n);i-->(s);)



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



#ifdef DEBUG

#define DBG cout << __LINE__ << endl;

#else 

#define DBG

#endif 



//int xses[8] = {-1,1,0,0,-1,1,1,-1};

//int yses[8] = {0,0,-1,1,-1,1,-1,1};



//#define int ll



void solve()

{

	string s;

	cin >> s;



	int sum=0;

	int cnt2=0,cnt3=0;



	for(char c:s)

	{

		sum+=c-'0';

		if(c=='2')cnt2++;

		if(c=='3')cnt3++;

	}



	sum%=9;

	cnt2%=9;

	cnt3%=9;

	

	loop(i,cnt2+1)

	{

		loop(j,cnt3+1)

		{

			if((sum+6*j+2*i)%9==0){cout << "YES\n";return;}

		}

	}



	cout << "NO\n";

}



signed main()

{

	cin.tie(0);

	ios_base::sync_with_stdio(0);



	int t;

	cin >> t;

	while(t--)

		solve();





	return 0;

}



Code 2:
#include <bits/stdc++.h>

using namespace std;



#define ll long long

#define pb push_back

#define F first

#define S second

#define pii pair<int,int>

#define vi vector<int>

#define vpii vector<pii>



#define loop(i,n) sloop(0,i,n)

#define sloop(s, i, n) for(ll i=(s);i<(n);i++)

#define rloop(i,n) rsloop(0,i,n)

#define rsloop(s,i,n) for(ll i=(n);i-->(s);)



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



#ifdef DEBUG

#define DBG cout << __LINE__ << endl;

#else 

#define DBG

#endif 



//int xses[8] = {-1,1,0,0,-1,1,1,-1};

//int yses[8] = {0,0,-1,1,-1,1,-1,1};



//#define int ll



void solve()

{

	string s;

	cin >> s;



	int sum=0;

	int cnt2=0,cnt3=0;



	for(char c:s)

	{

		sum+=c-'0';

		if(c=='2')cnt2++;

		if(c=='3')cnt3++;

	}



	sum%=9;

	cnt2=min(cnt2,9);

	cnt3=min(cnt3,3);

	

	loop(i,cnt2+1)

	{

		loop(j,cnt3+1)

		{

			if((sum+6*j+2*i)%9==0){cout << "YES\n";return;}

		}

	}



	cout << "NO\n";

}



signed main()

{

	cin.tie(0);

	ios_base::sync_with_stdio(0);



	int t;

	cin >> t;

	while(t--)

		solve();





	return 0;

}



Answer: 2
Problem: 2050C - Uninteresting Number
Language: c++17 

Code 1:
#include <algorithm>

#include <bits/stdc++.h>

#include <vector>



using namespace std;

#define ll long long

int const mod = 998244353, N = 2e5 + 10;

#define fast                                                                   \

  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

int dp[N][13];

int n;

string s;

int rec(int i, int sum) {

  if (sum % 9 == 0) {

    return 1;

  }

  if (i == n) {

    return 0;

  }

  int &ret = dp[i][sum];

  sum %= 9;

  int op1 = 0, op2 = 0, op3 = 0;

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

    op1 = rec(i + 1, sum + 2);

  }

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

    op2 = rec(i + 1, sum + 6);

  }

  op3 = rec(i + 1, sum);

  return ret = op1 | op2 | op3;

}



int main() {

  fast;

  memset(dp, -1, sizeof dp);

  int t;

  cin >> t;

  while (t--) {

    // cin >> n;

    cin >> s;

    n = s.size();

    int sum = 0;

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

      sum += (s[i] - '0');

    }

    cout << (rec(0, sum) ? "YES" : "NO") << '\n';

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

      for (int j = 0; j <= 9; j++) {

        dp[i][j] = -1;

      }

    }

  }

}

Code 2:
#include <algorithm>

#include <bits/stdc++.h>

#include <vector>



using namespace std;

#define ll long long

int const mod = 998244353, N = 2e5 + 10;

#define fast                                                                   \

  ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)

int dp[N][10];

int n;

string s;

int rec(int i, int sum) {

  if (i == n) {

    return (sum % 9 == 0);

  }

  if (sum % 9 == 0) {

    return 1;

  }

  sum %= 9;

  int &ret = dp[i][sum];

  if(~ret){

    return ret;

  }

  ret = 0;

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

    ret |= rec(i + 1, sum + 2);

  }

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

    ret |= rec(i + 1, sum + 6);

  }

  ret |= rec(i + 1, sum);

  return ret;

}



int main() {

  fast;

  memset(dp, -1, sizeof dp);

  int t;

  cin >> t;

  while (t--) {

    // cin >> n;

    cin >> s;

    n = s.size();

    int sum = 0;

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

      sum += (s[i] - '0');

    }

    cout << (rec(0, sum % 9) ? "YES" : "NO") << '\n';

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

      for (int j = 0; j <= 9; j++) {

        dp[i][j] = -1;

      }

    }

  }

}

Answer: 2
Problem: 2050C - Uninteresting Number
Language: c++23 

Code 1:
#include <bits/stdc++.h>
using namespace std;

int main(){
    int t, sum;
    vector<int> possibilities;
    map<int, int> found;
    string n;
    cin >> t;
    while(t--){
        cin >> n;
        sum = 0; found.clear();
        for (auto i : n){
            sum += i-48;
            if (i == '2')
                found[2]++;
            if (i == '3')
                found[3]++;
        }
        for(int i = 0; i < min(9, found[2]+1); i++){
            for (int j = 0; j < min(9, found[3]+1); j++){
                if ((sum + i*2 + j*6)%9 == 0){
                    cout << "YES" << endl;
                    found[0]++;
                    break;
                }
            }
            if (found[0])
                break;
        }
        if (!found[0])
            cout << "NO" << endl;
    }
}

Code 2:
#include <bits/stdc++.h>
using namespace std;

int main(){
    int t, sum;
    vector<int> possibilities;
    map<int, int> found;
    string n;
    cin >> t;
    while(t--){
        cin >> n;
        sum = 0; found.clear();
        for (auto i : n){
            sum += i-48;
            if (i == '2')
                found[2]++;
            if (i == '3')
                found[3]++;
        }
        for(int i = 0; i < min(8, found[2]+1); i++){
            for (int j = 0; j < min(8, found[3]+1); j++){
                if ((sum + i*2 + j*6)%9 == 0){
                    cout << "YES" << endl;
                    found[0]++;
                    break;
                }
            }
            if (found[0])
                break;
        }
        if (!found[0])
            cout << "NO" << endl;
    }
}

Answer: 1
Problem: 2050C - Uninteresting Number
Language: c++17 

Code 1:
#include <bits/stdc++.h>
#define inpv(v,n) for(int i=0;i<n;i++)cin>>v[i]
#define disp(v) for(auto x:v) cout<<x<<" "; cout<<"\n"
#define srt(x) sort(x.begin(),x.end())
#define N "\n"
using namespace std;
typedef long long ll;
typedef vector <ll> vll;

void solve() {
    // Your code here
    string s;
    cin>>s;
    int sum=0;
    ll three=0;
    ll two=0;
    for(ll i=0;i<s.length();i++)
    {
        sum+=s[i]-'0';
        switch(s[i])
        {
            case '2':two++;
            break;
            case '3':three++;
            break;
        }
    }
    sum=sum%9;
    bool yes=false;
    two=min(9LL,two);
    three=min(three,9LL);
    for(ll i=0;i<=two;i++)
    {
        for(ll j=0;j<=three;j++)
        {
            if((i*2+j*6+sum)%9==0)
            {
                yes=true;
                break;
            }
        }
    }
    if(sum==0)yes=true;
    //cout<<two<<" "<<three<<N;
    cout<<(yes?"YES\n":"NO\n");
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll t;
    cin >> t;
    while (t--) solve();
}

Code 2:
#include <bits/stdc++.h>
#define inpv(v,n) for(int i=0;i<n;i++)cin>>v[i]
#define disp(v) for(auto x:v) cout<<x<<" "; cout<<"\n"
#define srt(x) sort(x.begin(),x.end())
#define N "\n"
using namespace std;
typedef long long ll;
typedef vector <ll> vll;

void solve() {
    // Your code here
    string s;
    cin>>s;
    int sum=0;
    ll three=0;
    ll two=0;
    for(ll i=0;i<s.length();i++)
    {
        sum+=s[i]-'0';
        switch(s[i])
        {
            case '2':two++;
            break;
            case '3':three++;
            break;
        }
    }
    sum=sum%9;
    bool yes=false;
    two=two%9;
    three=three%9;
    for(ll i=0;i<=two;i++)
    {
        for(ll j=0;j<=three;j++)
        {
            if((i*2+j*6+sum)%9==0)
            {
                yes=true;
                break;
            }
        }
    }
    if(sum==0)yes=true;
    //cout<<two<<" "<<three<<N;
    cout<<(yes?"YES\n":"NO\n");
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    ll t;
    cin >> t;
    while (t--) solve();
}

Answer: 1
Problem: 2050C - Uninteresting Number
Language: c++23 

Code 1:
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long twth=1, tw=1, th=1; twth<=min(twos,threes) || tw<=twos || th<=threes; tw++, th++, twth++){
                if(tw<=twos && (sum+2*tw)%9==0){
                    // cout<<"twos: "<<tw<<endl;
                    flag=true;
                    break;
                }
                if(th<=threes && (sum+6*th)%9==0){
                    // cout<<"threes: "<<th<<endl;
                    flag=true;
                    break;
                }
                if((sum+8*twth)%9==0){
                    // cout<<"twos and threes: "<<twth<<endl;
                    flag=true;
                    break;
                }
            }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}

Code 2:
#include <iostream>
#include <vector>
#include <bits/stdc++.h>
#include <algorithm>

using namespace std;

int main(){
    int tc;
    cin>>tc;
    for(int _=0; _<tc; _++){
        string x;
        cin>>x;
        long long sum=0;
        int twos=0;
        int threes=0;
        for(long long i=0; i<x.length(); i++){
            int n = x[i]-48;
            sum+=n;
            if(n==2) twos++;
            if(n==3) threes++;
        }

        bool flag=false;
        if(sum%9==0 || sum==0){
            flag=true;
        } else {
            for(long long tw=0; tw<=twos; tw++){
                for(long long th=0; th<=threes; th++){
                    if((sum+2*tw+6*th)%9==0){
                        // cout<<"twos: "<<tw<<endl;
                        flag=true;
                        break;
                    }
                }
            }
            // if(!flag){
            //     for(long long th=0; th<=threes; th++){
            //         if((sum+6*th)%9==0){
            //             // cout<<"threes: "<<th<<endl;
            //             flag=true;
            //             break;
            //         }
            //     }
            // }
            // if(!flag){
            //     for(long long twth=1; twth<=min(twos,threes);twth++){
            //         if((sum+8*twth)%9==0){
            //             // cout<<"twos and threes: "<<twth<<endl;
            //             flag=true;
            //             break;
            //         }
            //     }                
            // }
        }
        if(flag) cout<<"YES"<<endl;
        else cout<<"NO"<<endl;

    }
    return 0;
}

Answer: 2
Problem: 2050C - Uninteresting Number
Language: c++20 

Code 1:
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"
#define read(arr) for (auto &x : arr) cin >> x;
#define print(arr) for (auto &x : arr) cout << x << ' '; cout << endl;
#define sortv(arr) sort(arr.begin(), arr.end())
#define sorta(arr) sort(arr.begin(), arr.end())
#define revers(arr) reverse(arr.begin(), arr.end())
#define ll long long
#define vi vector<int>
#define fastread() (ios_base::sync_with_stdio(false), cin.tie(NULL))

void solve() {
    ll n;
    cin>>n;
    ll c2=0,c3=0;
    ll sum=0;
    while(n){
        int l =n%10;
        if(l==2){
            c2++;
        }
        if(l==3){
            c3++;
        }
        sum+=l;
        n/=10;
    }
    if(c2>10) c2=10;
    if(c3>10) c3=10;
    for(int i =0;i<=c2;i++){
       for(int j =0;j<=c3;j++){
        ll x =sum + i*2 + j*6;
        if(x%9==0){
            cout<<"YES"<<endl;
            return;
        }
       }
    }
    cout<<"NO"<<endl;
    return ;
}

int main() {
    fastread(); // Enable fast input/output
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Code 2:
#include <bits/stdc++.h>
using namespace std;

#define endl "\n"
#define read(arr) for (auto &x : arr) cin >> x;
#define print(arr) for (auto &x : arr) cout << x << ' '; cout << endl;
#define sortv(arr) sort(arr.begin(), arr.end())
#define sorta(arr) sort(arr.begin(), arr.end())
#define revers(arr) reverse(arr.begin(), arr.end())
#define ll long long
#define vi vector<int>
#define fastread() (ios_base::sync_with_stdio(false), cin.tie(NULL))

void solve() {
    string s;
    cin>>s;
    ll c2=0,c3=0;
    ll sum=0;
    for(auto &i:s){
        if(i=='2') c2++;
        if(i=='3') c3++;
        sum+=i-'0';
    }
    if(c2>10) c2=10;
    if(c3>10) c3=10;
    for(int i =0;i<=c2;i++){
       for(int j =0;j<=c3;j++){
        ll x =sum + i*2 + j*6;
        if(x%9==0){
            cout<<"YES"<<endl;
            return;
        }
       }
    }
    cout<<"NO"<<endl;
    return ;
}

int main() {
    fastread(); // Enable fast input/output
    int t;
    cin >> t;
    while (t--) {
        solve();
    }
    return 0;
}

Answer: 2
Problem: 2050C - Uninteresting Number
Language: c++23 

Code 1:
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define all(x) x.begin(),x.end() ;
using namespace std;
int  main(){
    
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);cout.tie(NULL);
    int testcase;
    cin>>testcase;
    while(testcase--){
        string s;
        cin>>s;
        int cnttwo=0,cntthree=0 ,sum=0;
        for(int i=0;i<s.size();i++){
            sum+=(s[i]-'0');
            if(s[i]=='2')cnttwo++;
            if(s[i]=='3')cntthree++;
        }
        if(sum%9==0)cout<<"Yes\n";

        else{
        bool flag=false;
for(int i=0;i<=cnttwo;i++){
    for(int j=0;j<=cntthree;j++){
        int suma=sum+2*i+6*j;
//        cout<<suma<<" " ;
        if(suma%9==0){
        flag=true;
        break;
    }
  }
}
       
     flag?cout<<"Yes\n":cout<<"No\n";
      } 

    }
    return 0;
}
// 2-----4
// 3-----3
// 27
// {2}->29,31,33,35,41,47,53
// {3}->33,39,45,47,49,51,53

// {8}->35,43,51
// 2-29,31,37,43
// 3-33,39,41,43
// 8->35,43
// 2,3
// 41-
// 2--3
// 3--2
// 41-
// 2=>43,45,47,53,59
// 3=>47,53,55,57,59
// // 8=>49,57,5930+2
// 10-3
// 7-2
// 69+56=


Code 2:
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define all(x) x.begin(),x.end() ;
using namespace std;
int main(){
    
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);cout.tie(NULL);
    int testcase;
    cin>>testcase;
    while(testcase--){
        string s;
        cin>>s;
        int cnttwo=0,cntthree=0 ,sum=0;
        for(int i=0;i<s.size();i++){
            sum+=(s[i]-'0');
            if(s[i]=='2')cnttwo++;
            if(s[i]=='3')cntthree++;
        }
        if(sum%9==0)cout<<"Yes\n";
        
        else{
        vector<int>two;
        vector<int>six;
        vector<int>eight;
        int sum_=sum,sum__=sum,sum___=sum;
        for(int i=0;i<cnttwo;i++){
                sum_+=2;
                two.push_back(sum_);
        }
        for(int i=0;i<cntthree;i++){
            sum__+=6;
            sum_+=6;
            six.push_back(sum__);
            two.push_back(sum_);
        }
        for(int i=0;i<cnttwo;i++){
                sum__+=2;
                six.push_back(sum__);
        }
        for(int i=0;i<min(cnttwo,cntthree);i++){
            sum___+=8;
            eight.push_back(sum___);
        }
        set<int>st;
        for(auto it: two){
            st.insert(it);
        }
       for(auto it: six)st.insert(it);
        for(auto it: eight)st.insert(it);

            bool flag=false;
       for(auto it: st){
        if(it%9==0){
//            cout<<"Yes\n";
            flag=true;
        }
       }
       flag?cout<<"Yes\n":cout<<"No\n";
      } 

    }
    return 0;
}


Answer: 1