-------------------------------------------
Greatest Common Divisor & Bézout’s identity
-------------------------------------------

For integers a and b, not both zero, the gcd g = gcd(a, b) is the largest
nonnegative integer dividing both, and it is also the least positive integer
representable as a linear combination as + bt with integers s, t.
The extended Euclidean algorithm computes g together with Bézout coefficients
s and t satisfying as + bt = g. The gcd is unique and nonnegative; the
coefficients are not unique—every solution has the form s + k·(b/g), t − k·(a/g)
for any integer k.

Quick checks: g divides a and b, any common divisor of a and b divides g, and
the identity as + bt = g holds exactly.
Special cases: gcd(a, 0) = |a|, gcd(0, b) = |b|, and gcd(0, 0) is undefined.
