pub(crate) fn multiply_and_divide<T: Integer + Clone>(r: T, a: T, b: T) -> T
Calculate r * a / b, avoiding overflows and fractions.
Assumes that b divides r * a evenly.