I can't seem to find out why my answer is wrong, can someone give me a sample input for which my program prints an incorrect answer, please? Here's the link to my solution. http://www.codechef.com/viewsolution/4118121 asked 20 Jun '14, 11:48

your power function has no modding and is the reason you are getting wrong ans. For large value of n you will exceed long long limit and get wrong values. answered 20 Jun '14, 14:21
So that's why it worked with my inputs but failed when I submitted it. Thank you!
(20 Jun '14, 20:39)
I made changes to the original code using mod, but I am still getting WA result when I submit my solution. (It still works with smaller values though.) Here's a link to my solution: http://www.codechef.com/viewsolution/4120414
(21 Jun '14, 01:22)
