Fib gcd code doubt

failing test cases

@rohit_1906 hey, you are calculating Fib number in O(n) that will result in time out as the n can be very large.
Also this question utilizes a mathematical property:
GCD(Fib(A),Fib(B))=Fib(GCD(A,B))
So we need to form a seg tree on the array (not on Fibonacci number)
After number calculation we will need to use matrix exponentiation to get Fib number.
Here is efficient code:

your solution is giving tle for one test case
any better approach

@rohit_1906 hey please check this code once:

just have one doubt … this code and previous one you sent are ditto same …i couldnt find any change but previous one gave tle …this one didnt…how??..if you have changed something please tell me at what line is the change

@rohit_1906 Hey ,Almost same hi tha ,woh compiler kabhi kabhar dikkt kr skta hai.