PPTEST Polo the Penguin and the Test

CodeChef: Practical coding for everyone My code gives correct solution for the same test case. I used greedy approach. But the submission got failed telling ‘Wrong Answer’ . what is the problem with my code?