#include using namespace std;vector > equation_set;int get_inv(int n,int x){ int nn=n; x=x%n; pair X(0,1),N(1,0); while(x){ N={N.first-n/x*X.first,N.second-n/x*X.second}; n=n%x; swap(n,x); swap(N,X); } if(n==1)return (N.second%nn+nn)%nn; else return 0;}int degrade(int n,int x){ for(int i=2,p=1;i*i<=n;++i,p=1){ if(n%i)continue; while(n%i==0){ p*=i; n/=i; } equation_set.emplace_back(p,x%p); } if(n>1)equation_set.emplace_back(n,x%n);}void print_equation_set(){ for(auto &a: equation_set) cout<<"x = "< <<" (mod "< <<")\n";}int main(){ ios::sync_with_stdio(0); int n,x,num; cout<<"=======================================\n"; cout<<"equation number: "; while(cin>>num){ cout<<"# if x=a(mod b), then input b a\n"; equation_set.clear(); //input while(num--){ cin>>n>>x; degrade(n,x%n); } //output sort(equation_set.begin(),equation_set.end()); cout<<"\ndegraded equations:\n"; print_equation_set(); //arrange vector > tmp; vector vis(equation_set.size(),false); bool error=false; for(int i=0,j,last;i