#include using namespace std; typedef long long ll; const int INF=0x3f3f3f3f; const ll LLINF=0x3f3f3f3f3f3f3f3fLL; const int MAX=1e7+10; //x is a prime if prime[x]==x(x>=2) int p[MAX],tot,prime[MAX]; void init_prime(int n) { int i,j; tot=0; memset(prime,0,sizeof prime); prime[1]=1; for(i=2;i<=n;i++) { if(!prime[i]) prime[i]=p[tot++]=i; for(j=0;j res; res.push_back(-1); for(i=1;i