I want to understand why my code is getting WA for the problem ALATE in LoC Aug 2017.
My solution compute for query 1 the function and store it in an array. I use a recursive method for that.
While computing the function, I store the divisors for each element. For example, if I compute func for x, for each i involved, I store x as a divisor of i (since i is always a multiple of x). For query 2, I update the value of func for the divisors of the x given.
Here is my code : https://www.codechef.com/viewsolution/15155600
Sorry for my approximative English :).