This documentation is automatically generated by online-judge-tools/verification-helper
#include "math/extgcd.hpp"#pragma once
#include "./base.hpp"
namespace matumoto {
constexpr ll extgcd(ll a, ll b, ll &x, ll &y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
ll d = extgcd(b, a % b, y, x);
y = y - (a / b) * x;
return d;
}
} // namespace matumoto#line 2 "math/extgcd.hpp"
#line 2 "math/base.hpp"
namespace matumoto {
using namespace std;
using ll = long long;
} // namespace matumoto
#line 4 "math/extgcd.hpp"
namespace matumoto {
constexpr ll extgcd(ll a, ll b, ll &x, ll &y) {
if (b == 0) {
x = 1;
y = 0;
return a;
}
ll d = extgcd(b, a % b, y, x);
y = y - (a / b) * x;
return d;
}
} // namespace matumoto