The problem is this: http://codeforces.com/problemset/problem/300/C Thanks to it, I managed to understand a bit better the usage and concept of modular multiplicative inverse. Namely, if we want to compute x^(1) % (M=a big prime number) then we can use Euler's Theorem and do: x^(M2) % M and compute it by fast exponentiantion, is this so? However, many contestants there used this function:
My doubt is: Is this function doing the same job as the standard fast exponentiation function? If not, why? Thanks in advance, Bruno asked 26 Apr '13, 05:15

it was a nice learning from the last contest, although I was unable to solve it in the time constraints.