Greatest common divisor (GCD) and least common multiple (LCM).

const int p = 9;
const int q = 3;
std::gcd(p, q); // == 3
std::lcm(p, q); // == 9