This documentation is automatically generated by online-judge-tools/verification-helper
#include "math/extgcd.hpp"extgcd(T a, T b, T &x, T &y) : $ax + by = \text{gcd}(a, b)$ なる $x, y$ を求める。$O(\log{a+b})$ 程度
template<typename T>
T extgcd(T a, T b, T &x, T &y){
T d = a;
if(b != 0){
d = extgcd(b, a%b, y, x);
y -= (a/b) * x;
}else{
x = 1;
y = 0;
}
return d;
}#line 1 "math/extgcd.hpp"
template<typename T>
T extgcd(T a, T b, T &x, T &y){
T d = a;
if(b != 0){
d = extgcd(b, a%b, y, x);
y -= (a/b) * x;
}else{
x = 1;
y = 0;
}
return d;
}