SuperFunction

Can someone please explain the logic for (for SUBTASK 3 AND 4) CodeChef: Practical coding for everyone of this question?! I m unable to get the same form editorial.