Close

GCD queries

This problem is from Codechef January challenge. Click on the link to try this problem on your own. The problem statement is as follows. Given an array of size N and two indices L and R. We need to find the GCD (Greatest Common Divisor) of all the array elements except in the range [L,R].…