Angry cybrog

someone can explain the solution for angy cybrog. this one ------->> CodeChef: Practical coding for everyone
this sol look cool but don no what doing