C++复制void exgcd(ll a,ll b,ll &x,ll &y) { if(!b) { x=1; y=0; return ; } exgcd(b,a%b,y,x); y-=(a/b)*x; }