Getting WA in Convex Hull Problem

I am getting WA in Spoj Problem ,Build the fence . Link to the problem : https://www.spoj.com/problems/BSHEEP/
Link to my code : https://ideone.com/NpcblK . Can anyone help me to find the error or give any counter test case. I used graham scan algorithm to make my code efficient.

//