Codechef problem — POWOFPOW.
Please help me to solve this problem.
Problem link- link
Or help me to understand this solution.