GCD (X, YZ)

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