help for the problem on codechef
can anybody help me for solving this problem. link:-https://www.codechef.com/problems/AMR14G