mooyyu

M2 - EX欧几里得-翡蜀定理

c++11 math

template< class type >
void exgcd(type a, type b, type &x, type &y) {
	if (b) {
		exgcd(b, a % b, y, x);
		y -= a / b * x;
	} else x = 1, y = 0;	// 令y = 0防止多组数据溢出
}