 By adding/subtracting "u" multiples of the first cup and "v" multiples of the second cup, any volume "ua" + "vb" can be measured out.These volumes are all multiples of "g" = gcd("a", "b").The integers "s" and "t" of Bézout's identity can be computed efficiently using the extended Euclidean algorithm.