Can someone explain this problem my output is correct for the given sample inputs but none of the test case is a success

#include
using namespace std;

int main() {
int a[100],n,i,q,b,k,x,j;
cin>>n;
for(i=0;i<n;i++)
cin>>a[i];

cin>>q;
for(i=1;i<=q;i++)
{
	x=0;
	cin>>b;
	cin>>k;
	for(j=0;j<n;j++)
		if(b%a[j]==0)
			x++;

	if(k==x)
	cout<<"Yes"<<endl;

	else cout<<"No"<<endl;

}
return 0;

}

hi @muskanrathore01_4aab76aa7dafc189
refer this -->


if u still face any difficulty do let me know…

hi @muskanrathore01_4aab76aa7dafc189
i hope its clear now??

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.