Solution to the problem number 397 of AceptaelReto - 397.

Any questions do not hesitate to contact.

#include <iostream>
#include <math.h>
using namespace std;

int main() {
    long long int casos,numero;
    cin>>casos;
    while(casos!=0)
    {
        cin.ignore();
        cin>>numero;
        
        if(numero%3==0||numero%3==2)
            cout<<"SI"<<"\n";
        else
            cout<<"NO"<<"\n";
        casos--;
    }
   
    return 0;
}

Don't miss anything.

Keep in touch with Isaac Lozano Osorio!