摘要:
思路:对于a#includeusing namespace std;#define ll __int64ll p,m;ll gcd(ll a,ll b){ if(am){ //4 ans+=min(m,mb)+1; ll t=(p+m-ma)%p;//根据ma求出满足最小的y来 if(t>a>>b>>c>>d>>p>>m; ll ans=f(b,d)-f(b,c-1)-f(a-1,d)+f(a-1,c-1); ll tot=(b-a+1)*(d-c+1); ll g=gcd(ans,tot); ... 阅读全文