GCD (x, yz)

long long g = gcd(x, y);
return g * gcd(x / g, z);
namirin