Different GCD Subarray Query

HDU - 5869