Groups
Category
Modular arithmetic is about working with remainders, but programming languages often return negative remainders, so always normalize with (a % MOD + MOD) % MOD.
A linear Diophantine equation ax + by = c has integer solutions if and only if gcd(a, b) divides c.