#include <stdio.h>
#include <cstring>
#include <iostream>
using namespace std;
const int maxn = 1000000 + 5;
int prime[maxn];
void getprime(){
memset(prime,0,sizeof(prime));
for(int i = 2;i <=maxn;i++){
if(!prime[i]) prime[++prime[0]] = i;
for(int j = 1;j &l...