I have used Matrix Exponentiation to solve this problem as suggested in Hint video. I got the correct answer before taking MOD, It gives wrong answer otherwise…
my code: ide.codingblocks.com/s/289740
I have used Matrix Exponentiation to solve this problem as suggested in Hint video. I got the correct answer before taking MOD, It gives wrong answer otherwise…
my code: ide.codingblocks.com/s/289740