product of divisors(RE)

,

link of the problem D1 Problem - CodeChef

Here is the link of my ans

http://www.codechef.com/viewsolution/6783767

I have used the studied the blog Tutorial for Product of Divisors
and calculate the power n^p(in O(logn)).But I am getting runtime error.plz help