September challenge 2019-FIBEASY problem

i’am getting wrong answer for the fibeasy problem,i think i used the correct approach but i’am getting wrong is the link to the code.-

Consider the test case:
Your ans is 3 but the code gives 8
The code will give wrong answers at n = 2^m
Also This will give SiGSEGV for n = 1e7 because out of bound

Read editorial FIBEASY - Editorial because
1.Calculating i (in function mul can be upto 10^18) and further you are calculation fib upto i which is wrong and also TLE.
2.for n=2^n it will give wrong answer.

I did the test case but the answer is 3 itself!..,bro can u help me out.