exgcd(a,b,x,y) { if(b==0) x=1,y=0; else exgcd(a,a%b,y,x-(a/b)*y; }
ax1+by1=c; ax2+by2=c; a(x1-x2)+b(y1-y2)=0; x=x1-x2; y=y1-y2; g=gcd(a,b); a=a0*g; b=b0*g; a0*g*x+b0*g*y=0; x=-b0,y=a0; x=b0,y=-a0;
exgcd(a,b,x,y) { if(b==0) x=1,y=0; else exgcd(a,a%b,y,x-(a/b)*y; }
ax1+by1=c; ax2+by2=c; a(x1-x2)+b(y1-y2)=0; x=x1-x2; y=y1-y2; g=gcd(a,b); a=a0*g; b=b0*g; a0*g*x+b0*g*y=0; x=-b0,y=a0; x=b0,y=-a0;