April cook off div 4

Continuing the discussion from April cook off div 4:

Iam not able to know where iam going wrong
plz help me out
https://www.codechef.com/viewsolution/61871783

Hey @pramod_26 :wave:
The range of n variable is from 1 to 10^1000 which is much higher than the limits of integer and causing integer overflow in your solution try using the datatype of n as string.