# include# include # include # include # include using namespace std; int prime[10100]; int vis[10110]; int cot; void init_prime() { memset(vis,0,sizeof(vis)); cot=0; for(int i=2; i<=10100; i++) { if(!vis[i]) { prime[cot++]=i; for(int j=i*2; j<=10100; j+=i) vis[j]=1; } } } int main() { int n,size1,i,a,ans,j; int map[10100]; while(~scanf("%d%d",&size1,&n)) { init_prime(); memset(map,0,sizeof(map)); for(i=0; i =size1) { size1=prime[i]; break; } } for(i=0; i