Given integers S, N, and M, calculate the value of (((S^N) % 10)^M) % 1000000007. Since S, N, and M can be extremely large, use modular arithmetic and fast exponentiation.
You've read your 3 free write-ups
Sign up free to keep reading. Your account opens the first 10 questions of every company.