[closed]TAPALIN_use of MOD

please tell what is the problem in the following code.The code goes well till n=12 but gives wrong answer at n=13 as the modulo operation is not working fine.Please identify the problem :
http://www.codechef.com/viewsolution/2282475

You have to multiply with modular inverse of 25(not divide with 25). Use Fermat’s Little theorem to find modular multiplicative inverse of 25 modulo 1000000007( a prime number).

2 Likes

can you please tell where can i find details of the above mentioned theorem ??

check the editorial, there was a clear explanation on how to find it

ty…:slight_smile: