标签:frac gcd P5656 exgcd 模板 lambda
\[ax+by=d\\
ax_1+by_1=c\\
x_1=\frac{x*c}{gcd(a,b)},y_1=\frac{y*c}{gcd(a,b)}\\
对于最小正整数解有:x_1+\lambda\frac{b}{gcd(a,b)}>0\qquad y_1-\lambda\frac{a}{gcd(a,b)}>0\\
解得:\left\lceil\frac{-x_1+1}{\frac{b}{gcd(a,b)}}\right\rceil\le\lambda\le\left\lfloor\frac{y_1-1}{\frac{a}{gcd(a,b)}}\right\rfloor
\]
标签:frac,
gcd,
P5656,
exgcd,
模板,
lambda
From: https://www.cnblogs.com/wzhh/p/16730888.html