Sad Splits - SPLITPAIR

The first 2 TCs passed for me and the third one failed. I have used a similar logic but I do not know why it failed. If anyone can give me an idea for any edge case that my code will fail, it would be great. Thanks in advance.

#include
using namespace std;

void answer(int x){
if(x<=10){
cout<<“NO”<<endl;
return;
}
bool check = false;
int div = 10;
while(x/div > 0){
int a = x / div;
int b = x % div;
div *= 10;
if(a==0 || b==0){
continue;
}
else if(a%2==0 && b%2==0){
check = true;
break;
}
else if(a%2==1 && b%2==1){
check = true;
break;
}
else{
continue;
}
}
if(check==true){
cout<<“YES”<<endl;
}
else{
cout<<“NO”<<endl;
}
return;
}

int main() {
int t;
cin>>t;
while(t–){
int x;
cin>>x;
answer(x);
}
}

Check the output of the following hacking code for your solution.

Hacking Code