How to solve this problem from [http://www.spoj.com/problems/GCDEX2/] ? I have already solved this problem [http://www.spoj.com/problems/GCDEX/] with help of this blog [https://www.quora.com/profile/Surya-Kiran/Posts/A-Dance-with-Mobius-Function]. but I don't think i can use the same technique on the above problem because the N is too big.