#include #include #include #include using namespace std; using ll = long long; ll p[]={2,3,5,7,11,13,17,19,23};ll sqa(ll a,ll b,ll c){ll ret = 1;while(b){if(b&1)ret=(__int128)ret*a%c;a=(__int128)a*a%c;b>>=1;}return ret;}bool ML(ll x){if(x==2)return true;if(x<2||!(x&1))return false;ll y = x-1;int s = 0;while((y&1)==0)y>>=1,s++;for(ll c :p){if(c>=x)return true;ll d = sqa(c,y,x);if(d==1)continue;for(int j=0;j chk; do{ long long a = 0; for (int i=0;i