ICM2004 What is the problem?

I have started coding. This question seems straight forward. What is the catch here? I am unable to understand. The solutions to this posted is quite complicated. What is the reason for it? Help me out.