Alex goes shopping //showing correct for all input still could not pass it on hacker blocks

#include
using namespace std;
int main(){
int i,n,key,x,cs=0;
cin>>n;
int a[n];
for( i=0;i<n;i++){
cin>>a[i];
}
int m;
cin>>m;
while(m>0){
cin>>x;
cin>>key;
int count=0;

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

if(x%a[i]==0){
count++;
}
}

if(key==count){
cout<<“Yes”<<endl;
}
else{
cout<<“No”<<endl;
}

m--;

}
return 0;
}