Hyperrectangle GCD