点击查看折叠代码块
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
void exgcd(ll a,ll b,ll &x,ll &y){
if(!b){x=1;y=0;}
else{
exgcd(b,a%b,x,y);
ll temp = x;
x=y;
y=temp-(a/b)*y;
}
}
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
void exgcd(ll a,ll b,ll &x,ll &y){
if(!b){x=1;y=0;}
else{
exgcd(b,a%b,x,y);
ll temp = x;
x=y;
y=temp-(a/b)*y;
}
}