Bachet-Bézout theorem
How can you make 6 from groups of 12 and 42?
By subtracting three groups of 12 from one group of 42: 42 − 3 × 12 = 6. The Bachet-Bézout theorem guarantees this is possible whenever you target the GCD: 6 is the greatest common divisor of 12 and 42, so there exist two integers x and y such that 12x + 42y = 6, here x = −3 and y = 1.