Partially correct solution (70 pts) in FENCE (Contest 3)

I am getting 70 points for this question, and I can’t seem to identify what case I am missing. Solution : CodeChef: Practical coding for everyone