9702034 | CodeChef

Can someone help me in this?

I think test Case given is wrong too.