Code fury problem 1 doubt

question link : https://www.codechef.com/COFY2020/problems/GKSMNLC
answer link: https://www.codechef.com/viewsolution/37567947

can someone please explain why im getting wrong answer?