#36615: _Ans


yp11151230@yphs.tp.edu.tw (909-42蔡亞儒)

學校 : 臺北市私立延平高級中學
編號 : 197211
來源 : [150.129.72.232]
最後登入時間 :
2025-07-09 18:05:16

#include <bits/stdc++.h>

using namespace std;

int main(){
	int a,x,k;
	while(cin>>a){
		for(int i=0;i<a;i++){
			cin>>x;
			int flag=1;
			for(int j=2;j<=sqrt(x);j+=(j==2?1:2)){
				if(x%j==0){
					flag=0;
					break;
				}
			}
		if(flag==0) cout<<"N"<<endl;
		else cout<<"Y"<<endl;
		}
		
	}
	
	
	return 0;
}