格式问题很头疼啊 Input The first line of the input contains an integer T(1<=T<=20) which means the number of test cases. Then T lines follow, each line consists of two positive integers, A and B. Notice that the integers are very large, that means you shoul…
同样求逆元的题目,费马的条件,首先要保证p为质数,然后保证a与p互素. 数据范围问题,要保证在数据范围内,所以要b先模上mod #include<bits/stdc++.h> using namespace std; const int mod=9973; int qmi(int a,int b) { int ans=1; while(b) { if(b&1) ans=ans*a%mod; b/=2; a=a*a%mod; } return ans; } int t,n,b; int…