#include #include #include #include #include #include using namespace std; typedef long long ll; ll pow(ll a,ll b,ll mod){ ll as=1; while(b){ if(b&1)as=as*a%mod; b>>=1; a=a*a%mod; } return as; } vectoras,f; ll gcd(ll a,ll b,ll& x,ll& y){ if(b==0){ x=1;y=0; return a; } else{ ll r=gcd(b,a%b,y,x); y-=a/b*x; return r; } } void moxianxing(ll a,ll b,ll n){ ll x,y; ll d=gcd(a,n,x,y); as.clear(); if(b%d==0){ x%=n;x+=n;x%=n; as.push_back(x*(b/d)%(n/d)); for(ll i=1;irec; ll lisanshu(ll x,ll n,ll m){ ll s=(ll)(sqrt((double)m)+0.5); ll cur=1;rec.clear(); for(int i=0;i