5 2 2 6 9 3 15 2 3 4 4
1 3
Precompute prefixGcd and suffixGcd. Answer gcd(prefix[l-1], suffix[r+1]).