Https://www.codechef.com/viewsolution/34845351

https://www.codechef.com/viewsolution/34845351
i don’t know where i am getting wrong