1 #include<iostream>
 2 #include<cstdio>
 3 const int N=1e7+100;
 4 int is[N];
 5 int a[N];
 6 void seive()
 7 {
 8     long long cnt=0;
 9     is[0]=1;
10     is[1]=1;
11     for(int i=2;i<N;i++)
12     {
13         if(!is[i])a[cnt++]=i;
14         for(int j=0;j<cnt&&i*a[j]<N;j++)
15         {
16             is[i*a[j]]=1;
17             if(!(i%a[j]))break;
18         }
19     }
20 }
21 int main()
22 {
23     seive();
24     return 0;
25 }