can anybody please tell me the error in this? I was getting wrong answer but cant seem to find the error even after viewing the solution

#include

using namespace std;

void test_case(){

int n;

int coin5=0,coin10=0,coin15=0;

cin>>n;

while(n–){

int c;

cin>>c;

if(c==5){

coin5++;

}else if(c==10){

if(coin5==0){

cout<<“NO”<<endl;

return;

}else{

coin5–;

coin10++;

};

}

else if(c==15){

if(coin10==0){

if(coin5<2){

cout<<“NO”<<endl;

return;

}else{

coin5-=2;

coin15++;

};

}else{

coin10–;

coin15++;

};

};

};

cout<<“YES”<<endl;

}

int main()

{

int t;

cin>>t;

while(t–)

test_case();

return 0;

}